public static bool TryStatFileAndUpdateIndex(ITracer tracer, string path, MemoryMappedViewAccessor indexView, long offset) { try { MacFileSystem.NativeStat.StatBuffer st = MacFileSystem.StatFile(path); Index.IndexEntry indexEntry = new Index.IndexEntry(indexView, offset); indexEntry.MtimeSeconds = (uint)st.MTimespec.Sec; indexEntry.MtimeNanosecondFraction = (uint)st.MTimespec.Nsec; indexEntry.CtimeSeconds = (uint)st.CTimespec.Sec; indexEntry.CtimeNanosecondFraction = (uint)st.CTimespec.Nsec; indexEntry.Size = (uint)st.Size; indexEntry.Dev = (uint)st.Dev; indexEntry.Ino = (uint)st.Ino; indexEntry.Uid = st.UID; indexEntry.Gid = st.GID; return(true); } catch (Win32Exception e) { EventMetadata metadata = new EventMetadata(); metadata.Add("path", path); metadata.Add("exception", e.ToString()); tracer.RelatedError(metadata, "Error stat-ing file."); return(false); } }
public static bool TryGetNormalizedPath(string path, out string normalizedPath, out string errorMessage) { return(MacFileSystem.TryGetNormalizedPathImplementation(path, out normalizedPath, out errorMessage)); }