Qt setPermissions not setting permisions

后端 未结 2 1998
春和景丽
春和景丽 2021-01-20 04:30

I\'m not sure why but my code bellow does not set permissions for a file. Not sure what could be wrong with the code.

SYSTEM: Windows XP Pro SP2. Running in Admin ac

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-20 04:54

    Since you're mentionning WinXP Pro SP2, I'll assume your files are on NTFS.

    According to Qt's documentation :

    Note that Qt does not by default check for permissions on NTFS file systems, as this may decrease the performance of file handling considerably. It is possible to force permission checking on NTFS by including the following code in your source:

    extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
    

    Permission checking is then turned on and off by incrementing and decrementing qt_ntfs_permission_lookup by 1.

    qt_ntfs_permission_lookup++; // turn checking on
    qt_ntfs_permission_lookup--; // turn it off again
    

提交回复
热议问题