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

QDir - problems with directories which name ends with ".lnk" on windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.0.0 RC 1
    • 4.7.3, 4.8.x, 5.0.0
    • Core: Other
    • None
    • Windows 7 x64, QT4.7.3/QT Creator/MingW
      Tested on a flash drive.
    • Qt 5: 1022c3ce9d445fd482a62309b9a6c52495c04a92, Qt 4: 27055ae6b5102a5a81aafdb98c6f769a1cbb9084

      Hello,

      I know I know, where did I get the idea to name a directory toto.lnk ?
      Anyway, it is possible to do so under windows, and the directory is just like any other directory.

      However in Qt, any directory named *.lnk is treated as an invalid short-cut file.
      QFileInfo::isSymLink() returns true
      QFileInfo::isDir() returns false
      QDir::entryList and entryInfoList don't list such directories by default, you have to add QDir::System as a filter

      You can do a QDir::rmdir on it, but you cannot list its content, so rmdir fails if the directory is not empty.

      Thanks for your great work!
      Best regards,

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

            kleint Friedemann Kleint
            olaf69 Clément Nardi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes