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".
#include <windows.h>
#include <QtCore>
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
int main(int argc, char *argv[])
{
qt_ntfs_permission_lookup++;
// also tried qt_ntfs_permission_lookup = 1
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");
f.
setPermissions(QFile::WriteOther);
// returns false
f.remove();
// returns 1 and deletes fine
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");
return 0;
}
#include <windows.h>
#include <QtCore>
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
int main(int argc, char *argv[])
{
qt_ntfs_permission_lookup++;
// also tried qt_ntfs_permission_lookup = 1
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");
f.setPermissions(QFile::WriteOther);
// returns false
f.remove();
// returns 1 and deletes fine
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");
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks