Hello!
I'm unsing QT Jambi to test read permissions on files and directory from a Java application :
if (fileToRead.isDirectory()) {
QDir qDir
= new QDir(fileToRead.
getAbsolutePath());
System.out.println("Directory " + qDir.isReadable() + "--> " + fileToRead.getAbsolutePath());
} else {
System.out.println("File --> " + qFileInfo.isReadable() + "--> " + fileToRead.getAbsolutePath());
}
if (fileToRead.isDirectory()) {
QDir qDir = new QDir(fileToRead.getAbsolutePath());
System.out.println("Directory " + qDir.isReadable() + "--> " + fileToRead.getAbsolutePath());
} else {
QFileInfo qFileInfo = new QFileInfo(fileToRead.getAbsolutePath());
System.out.println("File --> " + qFileInfo.isReadable() + "--> " + fileToRead.getAbsolutePath());
}
To copy to clipboard, switch view to plain text mode
The isReadable() method return allways true, even if the file or the directory is read protected ...
Can anybody help me ...?
Thanks!
Fred
Bookmarks