Priority: P2: Important
Resolution: Won't Do
Affects Version/s: 4.8.0, 5.0.1, 5.1.1, 5.2.0, 5.3.1, 5.8.0
Fix Version/s: None
Component/s: Core: I/O
Environment:Windows 7, Qt 4.8.0, Qt 5.X
qtbug64121_diag.diff The Documentation (QFileInfo Class Reference) states that:
"On Windows, symlinks (shortcuts) are .lnk files. The reported size() is that of the symlink (not the link's target), and opening a symlink using QFile opens the .lnk file".
But the returned size is that of the target file, not the symlink file!
looking around in the source i found that in the file "qfilesystemengine_win.cpp" the function "QFileSystemEngine::fillMetaData" (l:808)
calls readLink which gets the path of the target...
This is wrong, it doesn't need to call readLink. Just use the symlink file path.
If we want information about the target we can call symLinkTarget().
line 808: change this
I compiled Qt with this changes and now it works as expected.