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.
- 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.
|For Gerrit Dashboard: QTBUG-75869|
|267175,25||Make Qt aware of symlinks and shortcuts on Windows||dev||qt/qtbase||Status: MERGED||+2||0|
|267423,8||Deprecate isSymLink of qFileInfo since Qt 5.15||dev||qt/qtbase||Status: ABANDONED||-2||0|
|271297,10||Make Qt aware of NTFS Junctions on Windows||5.15||qt/qtbase||Status: MERGED||+2||0|