Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.3, 5.0.1
-
None
-
Windows 7 / Visual Studio 2010 SP1.
-
a3304489e870555f5d01d02c0252103db2288898
Description
When QTemporaryFile attempts to create a new file in createFileFromTemplate, it fails if the test filename exists and is a directory. It appears that windows returns error code 5 (Access denied) rather than ERROR_FILE_EXISTS in this case, and this is not handled.
For example : Supplied template c:\Temp\file.XXXXXX , if a directory exists already called c:\Temp\file.Hp1234, QTemporaryFile::open() fails if this name is tested. Combined with the fact that the template name generation is not so random (PID + qrand()), this can cause recurring problems.