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

Make Qt aware of symlinks, junctions, and shortcuts on Windows

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • P3: Somewhat important
    • 5.14, 5.15
    • None
    • Core: I/O
    • None
    • Windows

    Description

      Qt has traditionally considered shortcut files (.lnk) on Windows to be the equivalent of symlinks on Unix file systems. Since NTFS has now for many versions supported proper symlinks, the interpretation of shotcut files as symlinks is confusing and error prone. The implementation as of today is also inconsistent.

      In addition, NTFS has the notion of junctions, which behave like hardlinks for directories, but need to be treated like symlinks in many ways (ie on the command line, they are removed via `rmdir` rather than with `del`). Qt currently has no way of reporting that a file system entry is a junction, which can lead to fatal data loss.

      Qt should

      • treat shortcut (.lnk) files as regular files (ie can delete them, report their file size), but be able to follow them
      • introduce a more comprehensive concept of "file type", reported by QFileInfo, replacing the overly simple "isSymLink" (which can then be made obsolete in Qt 5.15), so that applications can make well-informed decisions about how to treat a file system entry
      • provide appropriate implementations of basic file system operations (at the very least, use the correct way to remove a symlink in QFile::remove and QDir::remove/removeRecursively)

       

      This ticket collects the various relevant bugs in Qt.

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              vhilshei Volker Hilsheimer
              Harald Kjølberg Harald Kjølberg (Inactive)
              Volker Hilsheimer Volker Hilsheimer
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes