Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/file/file.cpp
Show First 20 Lines • Show All 848 Lines • ▼ Show 20 Line(s) | 848 | if (details > 0) { | |||
---|---|---|---|---|---|
849 | entry.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, buff.st_mtime); | 849 | entry.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, buff.st_mtime); | ||
850 | #ifndef Q_OS_WIN | 850 | #ifndef Q_OS_WIN | ||
851 | entry.insert(KIO::UDSEntry::UDS_USER, getUserName(KUserId(buff.st_uid))); | 851 | entry.insert(KIO::UDSEntry::UDS_USER, getUserName(KUserId(buff.st_uid))); | ||
852 | entry.insert(KIO::UDSEntry::UDS_GROUP, getGroupName(KGroupId(buff.st_gid))); | 852 | entry.insert(KIO::UDSEntry::UDS_GROUP, getGroupName(KGroupId(buff.st_gid))); | ||
853 | #else | 853 | #else | ||
854 | #pragma message("TODO: st_uid and st_gid are always zero, use GetSecurityInfo to find the owner") | 854 | #pragma message("TODO: st_uid and st_gid are always zero, use GetSecurityInfo to find the owner") | ||
855 | #endif | 855 | #endif | ||
856 | entry.insert(KIO::UDSEntry::UDS_ACCESS_TIME, buff.st_atime); | 856 | entry.insert(KIO::UDSEntry::UDS_ACCESS_TIME, buff.st_atime); | ||
857 | #ifdef HAVE_ST_BIRTHTIME | ||||
858 | /* For example FreeBSD's and NetBSD's stat contains a field for | ||||
859 | * the inode birth time: st_birthtime | ||||
860 | * This however only works on UFS and ZFS, and not, on say, NFS. | ||||
861 | * Instead of setting a bogus fallback like st_mtime, only use | ||||
862 | * it if it is greater than 0. */ | ||||
863 | if (buff.st_birthtime > 0) { | ||||
864 | entry.insert(KIO::UDSEntry::UDS_CREATION_TIME, buff.st_birthtime); | ||||
865 | } | ||||
866 | #endif | ||||
857 | } | 867 | } | ||
858 | 868 | | |||
859 | // Note: buff.st_ctime isn't the creation time ! | 869 | // Note: buff.st_ctime isn't the creation time ! | ||
860 | // We made that mistake for KDE 2.0, but it's in fact the | 870 | // We made that mistake for KDE 2.0, but it's in fact the | ||
861 | // "file status" change time, which we don't care about. | 871 | // "file status" change time, which we don't care about. | ||
872 | // For at least FreeBSD and NetBSD, use st_birthtime. | ||||
862 | 873 | | |||
863 | return true; | 874 | return true; | ||
864 | } | 875 | } | ||
865 | 876 | | |||
866 | void FileProtocol::special(const QByteArray &data) | 877 | void FileProtocol::special(const QByteArray &data) | ||
867 | { | 878 | { | ||
868 | int tmp; | 879 | int tmp; | ||
869 | QDataStream stream(data); | 880 | QDataStream stream(data); | ||
▲ Show 20 Lines • Show All 493 Lines • Show Last 20 Lines |