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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.7.3, 4.8.x, 5.0.0
    • Fix Version/s: 5.0.0 RC 1
    • Component/s: Core: Other
    • Labels:
      None
    • Environment:
      Windows 7 x64, QT4.7.3/QT Creator/MingW
      Tested on a flash drive.
    • Commits:
      Qt 5: 1022c3ce9d445fd482a62309b9a6c52495c04a92, Qt 4: 27055ae6b5102a5a81aafdb98c6f769a1cbb9084

      Description

      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,

        Attachments

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes