MCPcopy Create free account
hub / github.com/catboost/catboost / MakeStat

Function MakeStat

util/system/fstat.cpp:111–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109#endif
110
111static 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
138static bool GetStatByHandle(TSystemFStat& fs, FHANDLE f) {
139#ifdef _win_

Callers 2

TFileStatMethod · 0.85
MakeFromFileNameMethod · 0.85

Calls 3

MakeStatFromStructStatFunction · 0.85
FileTimeToTimespecFunction · 0.85
GetFileModeFunction · 0.85

Tested by

no test coverage detected