Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3, 6.6.1
-
-
9d8e23328 (dev), 164363e18 (6.7)
-
Foundation Sprint 105
Description
Randomly getting "Access is denied" error when saving files with QSaveFile.
To reproduce the issue:
- Create " LYNX " folder in the following path C:\Users\<YourUserName>\Documents\
- Set the proper value of "user" variable in the code below.
- Build and run the following code:
#include <QSaveFile> #include <QDebug> void test(QString username){ qInfo() << "running qsavefile test"; const auto filePath = "C:/Users/" + username + "/Documents/LYNX/qsavefile-test.lynx"; for (int i = 0; i < 10000; i++) { QByteArray data(4, 'd'); QSaveFile file(filePath); if (!file.open(QIODevice::WriteOnly)) { qCritical() << "qsavefile open failed: " << i << ": " << file.errorString(); return; } file.write(data); if (!file.commit()) { qCritical() << "qsavefile commit failed: " << i << ": " << file.error() << ": " << file.errorString(); return; } qDebug() << "pass" ; } qInfo() << "test complete"; } int main(int argc, char *argv[]) { QString user = "" ;// set YourUserName test(user); return 0; }
Note: the number of iterations varies with each run.
Attachments
Issue Links
- relates to
-
QTBUG-57299 QSaveFile failure in dropbox folder
- Closed