Results 1 to 1 of 1

Thread: file setPermission doesn't work appropriately in Win7 for different accounts

  1. #1
    Join Date
    Jul 2008
    Location
    Munich
    Posts
    73
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: file setPermission doesn't work appropriately in Win7 for different accounts

    My program generates some txt config files. Each time running the program will read and modify this config file.

    I am setting any user can read, write, excute this config file.
    Qt Code:
    1. file.setPermissions(QFile::WriteOther | QFile::ReadOther | QFile::ExeOther);
    To copy to clipboard, switch view to plain text mode 

    Winxp works fine.

    Now I am testing the program in Win7. I found that, by default only the creator can modify the config file, even as admin, the permission will be denied if not the creator.

    This can be fixed by changing file property of course. But this is too annoy.
    Any one know how to solve this in code?


    Added after 21 minutes:


    I read qt doc. The piece of code I posted only set for current user. So this won't help for non-creator users.
    Win7 has more strict UAC rules...How can I solve this?


    Added after 46 minutes:


    For more information:
    I have my cofig file saved in C:\Document and settings\All users\application data\
    I think this is a suggested location to store config file.
    Last edited by stella1016; 5th July 2011 at 16:48.

Similar Threads

  1. QxtBlowfish doesn't work
    By fab_74 in forum Qt Programming
    Replies: 3
    Last Post: 8th June 2011, 22:07
  2. Example in Qt labs doesn't work
    By matko in forum Newbie
    Replies: 1
    Last Post: 19th November 2009, 18:59
  3. Program result writed by qDebug() to file doesn't work.
    By Vincenzo in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2009, 19:49
  4. Why this code doesn't work?
    By prykHetQuo in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2009, 19:08
  5. copies file doesn't work well
    By dreamer in forum Qt Programming
    Replies: 3
    Last Post: 10th May 2008, 22:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.