| 109 | #endif |
| 110 | |
| 111 | static void MakeStat(TFileStat& st, const TSystemFStat& fs) { |
| 112 | #ifdef _unix_ |
| 113 | MakeStatFromStructStat(st, fs); |
| 114 | #else |
| 115 | timespec timeSpec; |
| 116 | FileTimeToTimespec(fs.ftCreationTime, &timeSpec); |
| 117 | st.CTime = timeSpec.tv_sec; |
| 118 | st.CTimeNSec = timeSpec.tv_nsec; |
| 119 | |
| 120 | FileTimeToTimespec(fs.ftLastAccessTime, &timeSpec); |
| 121 | st.ATime = timeSpec.tv_sec; |
| 122 | st.ATimeNSec = timeSpec.tv_nsec; |
| 123 | |
| 124 | FileTimeToTimespec(fs.ftLastWriteTime, &timeSpec); |
| 125 | st.MTime = timeSpec.tv_sec; |
| 126 | st.MTimeNSec = timeSpec.tv_nsec; |
| 127 | |
| 128 | st.NLinks = fs.nNumberOfLinks; |
| 129 | st.Mode = GetFileMode(fs.dwFileAttributes, fs.ReparseTag); |
| 130 | st.Uid = 0; |
| 131 | st.Gid = 0; |
| 132 | st.Size = ((ui64)fs.nFileSizeHigh << 32) | fs.nFileSizeLow; |
| 133 | st.AllocationSize = st.Size; // FIXME |
| 134 | st.INode = ((ui64)fs.nFileIndexHigh << 32) | fs.nFileIndexLow; |
| 135 | #endif |
| 136 | } |
| 137 | |
| 138 | static bool GetStatByHandle(TSystemFStat& fs, FHANDLE f) { |
| 139 | #ifdef _win_ |
no test coverage detected