Ok, perhaps, I don't understand something. How should I "use" those permissions. I try to call f.setPermissions(QFile::WriteOther). For winapi function I don't need any permissions. For other files in the same folder I don't need permissions either, but this seems to be a strange avi file that, I guess, is used by something for preview or another background task. Answer to post #2 is the same: "No such file or directory".

Qt Code:
  1. #include <windows.h>
  2. #include <QtCore>
  3.  
  4. extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. qt_ntfs_permission_lookup++;
  9. // also tried qt_ntfs_permission_lookup = 1
  10.  
  11. QFile f("C:\\Users\\shroom\\Documents\\TestIt\\downloads\\The.Matrix.1999.iNTERNAL.DVDRip.XviD.AC3-XviK\\The.Matrix.1999.iNTERNAL.DVDRip.XviD.AC3.CD1-XviK.avi");
  12.  
  13. f.setPermissions(QFile::WriteOther);
  14.  
  15. // returns false
  16. f.remove();
  17.  
  18. // returns 1 and deletes fine
  19. DeleteFileA("C:/Users/shroom/Documents/TestIt/downloads/The.Matrix.1999.iNTERNAL.DVDRip.XviD.AC3-XviK/The.Matrix.1999.iNTERNAL.DVDRip.XviD.AC3.CD1-XviK.avi");
  20.  
  21. return 0;
  22. }
To copy to clipboard, switch view to plain text mode