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

QDir::mkpath fails on Windows if the working directory is not on the same drive

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 5.1.0
    • 5.1.0 RC1
    • Core: I/O
    • None
    • 74ca6034e413dc7ae8203d8eef1264357023d8af

      The fix for QTBUG-30046 (change 3e2cd8ef6f1ce4f46719890134c8bba9dbdb19ba) introduced a regression on Windows: depending on the current working directory, QDir::mkdir for an absolute path might fail.

      Analysis: The patch splits up the path, and calls ::CreateDirectory for every part. For absolute paths it starts with the drive letter, e.g. "D:". However, before calling CreateDirectory we call QFSFileEnginePrivate::longFileName(path), which is supposed to prefix a \\?\. Anyhow, since "D:" isn't a complete path it also tries to add the working directory at the end, if the working directory is on the same drive.

      If the working directory is on another drive, ::CreateDirectory is called with "\\?\D:\". This path, however, results in an windows error 5 - Access is denied.

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

            kkohne Kai Köhne
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes