[Qt-interest] QFile::SetPermissions useless on Windows?
Bartosh Wroblevksy
bartosh at live.com
Fri Feb 19 10:09:41 CET 2010
Thank you David, this is good to know.
> From: dc at remove-this.dcsoft.com
> Date: Thu, 18 Feb 2010 18:42:52 -0800
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QFile::SetPermissions useless on Windows?
>
> "Bartosh Wroblevksy" <bartosh at live.com> wrote in message
> news:BAY135-W200A8E7D13925C7E1335E0D24A0 at phx.gbl...
> >
>
> > 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
>
>
> Bartosh, FWIW I use:
>
> #ifdef Q_OS_WIN
> SetFileAttributes(..,);
> #endif
>
>
> and don't use QFile::setPermissions(). My code needs to set the Hidden
> attribute and I couldn't find an API in Qt to do it, probably because on
> Linux/Mac the way to make the file hidden is to insert a '.' at the start of
> the file. I'm not sure if SetFileAttributes() allows you to change the
> group, but FWIW, there is a pattern of falling back to Windows specific
> functions for file operations that Qt doesn't support.
>
> -- David
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
_________________________________________________________________
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/20100219/4bd07c9b/attachment.html
More information about the Qt-interest-old
mailing list