how to check for a file/directory if the file has read only permissions
-
how to check for a file if the file has read only permissions or if the directory has read only permissions
-
-
Take a look at QFileInfo
-
but if the file has
ls -al-r--r--r--
how to check that file cannot be written any sample 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 }