[Qt-interest] QFile::setPermissions useless on Windows?

Bartosh Wroblevksy bartosh at live.com
Mon Feb 15 17:06:54 CET 2010


Sorry for sending this again. Hotmail messed-up the formatting, I am sending this again because I am really looking forward to an answer.
Hello Trolls, Happy Chinese New Year and Happy Valentines Day...

Anyways I am writing because I am sort of lost about QFile::setPermissions. Part of the part of the problem is that I am not sure what to expect on Windows.
So I would expect that this code

qt_ntfs_permission_lookup++;

const bool retval = QFile::setPermissions(filePath, QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner |  QFile::ReadUser | QFile::WriteUser | QFile::ExeUser | QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup | QFile::ReadOther | QFile::WriteOther | QFile::ExeOther);
 qt_ntfs_permission_lookup--;

would make my file readable by everybody who logs into my Windows box. 
This does not happen, setPermissions does not do anything.So what should I expect on Windows? I looked into the code and I saw that under the hood, on setPermissions, the method _wchmod is used (http://msdn.microsoft.com/en-us/library/1z319a54(VS.80).aspx).
This method has no concept of groups. You can only have read_permitted and/or write_permitted. Yet Windows does have groups, it has a group "AllUsers".I can't setPermissions on that group when my Qt application runs from an administrator account. Is there something I am not understanding? Was QFile::SetPermissions Was this properly implemented in Qt 4.5.2?

Regards Bartosh 		 	   		  
_________________________________________________________________
Introducing Windows® phone.
http://go.microsoft.com/?linkid=9708122
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100215/7153dda4/attachment.html 


More information about the Qt-interest-old mailing list