I am not sure why, but my code below does not set permissions for the file. Not sure what might be wrong with the code.
SYSTEM: Windows XP Pro SP2. Run in administrator account as administrator. New frames and Qt files.
QFile::Permissions qpPerm1;
qpPerm1 = QFile::permissions("E:/dir1/dir2/File1.txt");
bool isOK=0;
isOK = QFile::setPermissions("E:/dir4/dir5/file2.txt",qpPerm1);
qout << "Perms set? " << isOK << endl;
The return value of TRUE ... claims to have set permissions, but it is not. To be clear, file2.txt is a copy of file1.txt. I set permissions file1 as something, but file2.txt has different permissions after running my code.
source
share