Created attachment 114415 [details] Screenshot showing properties window launched from Krusader The KIO ‘Properties’ window for a file shows three dates: Created: Modified: Accessed: However, the ‘Created’ date seems to be the ‘ctime’, which is *not* the creation time for the file. I have a bunch of files with apparently have been ‘modified’ *before* their ‘Created’ date, which is chronologically impossible. (See screenshot.) Note 1: What is shown in the ‘Properties’ window seems to depend on how it’s accessed. Accessing it via Dolphin doesn’t show the ‘Created’ field, but accessing it via Krusader does. (In both cases the window comes from KIO, not the host application.) Note 2: Unix/Linux filesystems doesn’t store the creation time in a *standard* field: https://unix.stackexchange.com/questions/7562/what-file-systems-on-linux-store-the-creation-time Note 3: Explanation of ctime, atime and mtime https://www.unixtutorial.org/2008/04/atime-ctime-mtime-in-unix-filesystems/
I believe the *real* creation time (if available) can be found using QFileInfo::birthTime() available in Qt 5.10+ https://doc.qt.io/qt-5/qfileinfo.html#birthTime
Technically, that file was "Created" on that given date. However, I can see your point. From what I can tell there's UDS_CREATION_TIME in UDSEntry which might be set to birth time depending on platform/fs.
*Real* creation time support on Linux is on my to-do list and is being tracked in Bug 381367. Sadly it's not trivial to simply use QFileInfo::birthTime() because the entire way we populate this information is different. There's a glibc API in 2.28+, but that's generally newer than what most distros are shipping. Using the raw syscall for the next year or two is an option until we can make glibc 2.28 a dependency. *** This bug has been marked as a duplicate of bug 381367 ***
The bug is a krusader bug. Due to: https://github.com/KDE/krusader/blob/a7ebda9a8054448f46feb044935236c86021bc29/krusader/FileSystem/fileitem.cpp#L207
More precisely here : https://github.com/KDE/krusader/blob/a7ebda9a8054448f46feb044935236c86021bc29/krusader/FileSystem/filesystem.cpp#L238 It uses stat ctime as creation time, but it is the change status time. To get the creation time, also called birth time, of files, there is a new syscall statx more complete than stat available since glib 2.28.
Thanks for the information Méven! Supporting statx with ifdef logic may be too costly. But we should at least fix the mix-up of creation time and ctime.
Proposed fix: https://phabricator.kde.org/D20741
Git commit 0920b04b4a841c69cd482e34cfe3e2949d79b9c1 by Alexander Bikadorov. Committed on 05/05/2019 at 19:20. Pushed by abikadorov into branch 'master'. FileSystem: Fix using creation time from KIO as changed time (ctime) Added new field to FileItem instead. And do not show dummy value in UI for missing file times - also for other time types. FIXED: [ 397398 ] Misleading ‘Created’ date in file properties Differential Revision: https://phabricator.kde.org/D20741 M +2 -2 krusader/DiskUsage/diskusage.cpp M +11 -8 krusader/FileSystem/fileitem.cpp M +12 -5 krusader/FileSystem/fileitem.h M +7 -3 krusader/FileSystem/filesystem.cpp M +1 -1 krusader/FileSystem/krquery.cpp M +2 -2 krusader/Panel/PanelView/krsort.cpp M +8 -4 krusader/Panel/PanelView/listmodel.cpp M +1 -1 krusader/Panel/listpanel.cpp M +10 -10 krusader/Synchronizer/synchronizer.cpp https://commits.kde.org/krusader/0920b04b4a841c69cd482e34cfe3e2949d79b9c1
Git commit 951ab660d7336c96a7e7a834f8499c6baa379dcd by Nikita Melnichenko. Committed on 01/07/2019 at 07:16. Pushed by melnichenko into branch 'stable'. FileSystem: Fix using creation time from KIO as changed time (ctime) Added new field to FileItem instead. And do not show dummy value in UI for missing file times - also for other time types. FIXED: [ 397398 ] Misleading ‘Created’ date in file properties Differential Revision: https://phabricator.kde.org/D20741 (cherry picked from commit 0920b04b4a841c69cd482e34cfe3e2949d79b9c1) M +2 -2 krusader/DiskUsage/diskusage.cpp M +11 -8 krusader/FileSystem/fileitem.cpp M +12 -5 krusader/FileSystem/fileitem.h M +7 -3 krusader/FileSystem/filesystem.cpp M +1 -1 krusader/FileSystem/krquery.cpp M +2 -2 krusader/Panel/PanelView/krsort.cpp M +8 -4 krusader/Panel/PanelView/listmodel.cpp M +1 -1 krusader/Panel/listpanel.cpp M +10 -10 krusader/Synchronizer/synchronizer.cpp https://commits.kde.org/krusader/951ab660d7336c96a7e7a834f8499c6baa379dcd