Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30058

QTemporaryFile fails in case of name collision with a directory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.1.0 Beta 1
    • 4.8.3, 5.0.1
    • Core: I/O
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mitch_curtis Mitch Curtis
            jds21 John Stark
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes