Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.7.0
-
None
Description
Simple test scenario:
const QString testFile{"c:\file.txt"}; const QString testLink{"c:\linkfile.lnk"}; //Note: above files do not exist. QFileInfo fileInfoLink{testLink}; //fileInfoLink.isSymLink() == true //fileInfoLink.isDir() == false //fileInfoLink.isFile() == false //QFileInfo::exists(testLink) == false QFileInfo fileInfo{testFile}; //fileInfo.isSymLink() == false //fileInfo.isDir() == false //fileInfo.isFile() == false //QFileInfo::exists(testFile) == false
So, it seems, that isSymLink only checks the name of the object (on windows, if it has ".lnk" extension), whereas isDir and isFile also check existance.
I know, that QFileInfo::exists() returns false, if the target of the symlink does not exists. But then, maybe isSymLink() should also return false in below scenarios:
- symlink does not exist
- target of the symlink does not exist
Right now, I do not see a way of checking if the symlink exists and if the symlink points to existing file.