Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
4.6.3, 4.7.0, 4.7.1, 4.8.0, 4.8.x, 5.0.0, Some future release
-
None
Description
How to reproduce:
QTemporary file xxx;
xxx.open();
// write something to file
xxx.close();
system(QString("move \"%1\" \"%2\"").arg(QDir::toNative(xxx.fileName()), "newname"));
last directive will fail!
because file handle is still open! Windows does not allow to do some operation on files which are still open.
Yes, documentation said that "It is safe to reopen....."', but it does not say about not closing file handle. I thought, that open is 'safe' because file name is unique.
Please add option to really close() temporary file, or fix documentation. I prefer first choice.
Even after real close(), file should be tried to remove in destructor according to autoRemove property
Attachments
Issue Links
- relates to
-
QTBUG-10856 QTemporaryFile generated file stays locked even after calling close()
- Closed