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

QDir::canonicalPath() on Windows returns empty string for existing directories in some cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 4.8.5
    • Core: I/O
    • None
    • Windows 7 x64, Qt build for MSVC 2008 32-bit
    • Windows

    Description

      QDir::canonicalPath() on Windows returns empty string if that directory has been just created. Attaching a testcase. I tried it also on Linux x86_64 and it worked as expected.

      I consider this bug somewhat serious. There was code in my application that I acknowledge it wasn't ideal, but it relied on QDir::canonicalPath() returning actual path to the directory after successful QDir::mkpath(). I didn't test it thoroughly on Windows (only on Linux) and it caused data loss bugs for my Windows users.

      Attachments

        1. qdir_test.cpp
          0.7 kB
          Bartosz Brachaczek
        2. qtbug27092_diag4.patch
          3 kB
          Friedemann Kleint
        3. qtbug27092_diag5.patch
          3 kB
          Friedemann Kleint
        4. qtbug27092.tar
          10 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              beevvy Bartosz Brachaczek
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes