Priority: P3: Somewhat important
Affects Version/s: 5.6.2
Fix Version/s: 5.11.0 Alpha
Component/s: Core: I/O
Commits:fe5edcee602f0ab2912bbdd1a21f4309ed7dbfd6 (qtbase/5.11, 14.2.2018, 5.11), f8cbde9b0afd427d25017b46209c3119c8919e5e (qtbase/5.9, 14.5.2018, 5.9.7)
When trying to commit() a QSaveFile in a dropbox folder, the operation often fails. In this case, a temporary file remains and
- file.error() returns 10
- file.errorString() returns "The process cannot access the file because it is being used by another process."
This bug has two parts:
1) The commit() failure itself. Pausing Dropbox fixes the issue. Therefore it may be that dropbox is simply blocking the file and Qt cannot do anything about it. Still it would be nice if there was a solution.
2) According to the documentation of QSaveFile::commit(): "If an error happened during writing, deletes the temporary file and returns false."
The deletion of the temporary file is not happening.
For reference, this bug was seen by a number of our users:
See src\corelib\io\qtemporaryfile.cpp:209 createFileFromTemplate() FILE_SHARE_WRITE