<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[how to check for a file&#x2F;directory if the file has read only permissions]]></title><description><![CDATA[<p dir="auto">how to check for a file if the file has read only permissions  or if the directory has read only permissions</p>
]]></description><link>https://forum.qt.io/topic/96054/how-to-check-for-a-file-directory-if-the-file-has-read-only-permissions</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 03:08:13 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/96054.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 29 Oct 2018 07:30:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to how to check for a file&#x2F;directory if the file has read only permissions on Mon, 29 Oct 2018 08:37:33 GMT]]></title><description><![CDATA[<pre><code>const QFileInfo info("some/file");
if (info.permission(QFile::WriteOwner | QFile::WriteGroup | QFile::WriteUser)) {
  // file is writable!
} else {
  // file is read only
}

// Or even simpler:
if (info.isWritable()) {
  // Yup
} else {
  // Nope
}
</code></pre>
]]></description><link>https://forum.qt.io/post/489701</link><guid isPermaLink="true">https://forum.qt.io/post/489701</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Mon, 29 Oct 2018 08:37:33 GMT</pubDate></item><item><title><![CDATA[Reply to how to check for a file&#x2F;directory if the file has read only permissions on Mon, 29 Oct 2018 08:24:26 GMT]]></title><description><![CDATA[<p dir="auto">but if the file has<br />
ls -al</p>
<p dir="auto">-r--r--r--</p>
<p dir="auto">how to check that  file cannot be written any sample code</p>
]]></description><link>https://forum.qt.io/post/489699</link><guid isPermaLink="true">https://forum.qt.io/post/489699</guid><dc:creator><![CDATA[Qt Enthusiast]]></dc:creator><pubDate>Mon, 29 Oct 2018 08:24:26 GMT</pubDate></item><item><title><![CDATA[Reply to how to check for a file&#x2F;directory if the file has read only permissions on Mon, 29 Oct 2018 07:43:21 GMT]]></title><description><![CDATA[<p dir="auto">Take a look at <a href="http://doc.qt.io/qt-5/qfileinfo.html#permissions" target="_blank" rel="noopener noreferrer nofollow ugc">QFileInfo</a></p>
]]></description><link>https://forum.qt.io/post/489694</link><guid isPermaLink="true">https://forum.qt.io/post/489694</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 29 Oct 2018 07:43:21 GMT</pubDate></item><item><title><![CDATA[Reply to how to check for a file&#x2F;directory if the file has read only permissions on Mon, 29 Oct 2018 07:43:02 GMT]]></title><description><![CDATA[<p dir="auto">Use <a href="https://doc.qt.io/qt-5/qfile.html#permissions" target="_blank" rel="noopener noreferrer nofollow ugc">QFile::permissions()</a></p>
]]></description><link>https://forum.qt.io/post/489693</link><guid isPermaLink="true">https://forum.qt.io/post/489693</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Mon, 29 Oct 2018 07:43:02 GMT</pubDate></item></channel></rss>