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

Bartosh Wroblevksy bartosh at live.com
Mon Feb 15 16:38:48 CET 2010


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?

Regards,Bartosh
 		 	   		  
_________________________________________________________________





More information about the Qt-interest-old mailing list