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

QDir::cleanPath behaviour differs in Qt5 vs Qt4 with regard to UNC paths.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.10.1
    • Core: I/O
    • None
    • Windows

    Description

      In Qt 4.8.7 (the version of Qt 4 we're transitioning from), QDir::cleanPath works as-expected when switching servers for UNC paths:

      QDir::cleanPath("//server1/../server2/path/to/file.txt") == "//server2/path/to/file.txt"

      Under Qt 5 (5.10.1 to be exact), this behaviour no longer works, QDir::cleanPath will no longer go below the server-name, resulting in the path being unchanged - unfortunately this unchanged path does not work with anything (e.g. QFileInfo(path).exists() returns false, where as under Qt4 it would return true).

      This makes handling multiple files difficult when they're spread across different network locations (our typical use case is converting absolute <-> relative paths, where one file may be on a different network share to the reference file).

      Attachments

        1. qtbug71720.zip
          1 kB
        2. QTBUG-72120.zip
          0.6 kB

        Issue Links

          Activity

            People

              thiago Thiago Macieira
              andyvincent Andy Vincent
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: