public Result GetFileTimeStampRaw(out FileTimeStampRaw timeStamp, string path) { if (IsDisposed) { timeStamp = default; return(ResultFs.PreconditionViolation.Log()); } return(GetFileTimeStampRawImpl(out timeStamp, path)); }
public Result GetFileTimeStamp(out FileTimeStampRaw timeStamp, U8Span path) { timeStamp = default; Result rc = FindFileSystem(out FileSystemAccessor fileSystem, out U8Span subPath, path); if (rc.IsFailure()) { return(rc); } return(fileSystem.GetFileTimeStampRaw(out timeStamp, subPath)); }
public FileTimeStampRaw GetFileTimeStampRaw(string path) { path = PathTools.Normalize(path); string localPath = ResolveLocalPath(path); FileTimeStampRaw timeStamp = default; timeStamp.Created = new DateTimeOffset(File.GetCreationTime(localPath)).ToUnixTimeSeconds(); timeStamp.Accessed = new DateTimeOffset(File.GetLastAccessTime(localPath)).ToUnixTimeSeconds(); timeStamp.Modified = new DateTimeOffset(File.GetLastWriteTime(localPath)).ToUnixTimeSeconds(); return(timeStamp); }
public Result GetFileTimeStamp(out FileTimeStampRaw timeStamp, string path) { timeStamp = default; Result rc = FindFileSystem(path.AsSpan(), out FileSystemAccessor fileSystem, out ReadOnlySpan <char> subPath); if (rc.IsFailure()) { return(rc); } return(fileSystem.GetFileTimeStampRaw(out timeStamp, subPath.ToString())); }
public FileTimeStampRaw GetFileTimeStampRaw(string path) { string localPath = ResolveLocalPath(PathTools.Normalize(path)); if (!GetFileInfo(localPath).Exists) { ThrowHelper.ThrowResult(ResultFs.PathNotFound); } FileTimeStampRaw timeStamp = default; timeStamp.Created = new DateTimeOffset(File.GetCreationTime(localPath)).ToUnixTimeSeconds(); timeStamp.Accessed = new DateTimeOffset(File.GetLastAccessTime(localPath)).ToUnixTimeSeconds(); timeStamp.Modified = new DateTimeOffset(File.GetLastWriteTime(localPath)).ToUnixTimeSeconds(); return(timeStamp); }
protected virtual Result GetFileTimeStampRawImpl(out FileTimeStampRaw timeStamp, string path) { timeStamp = default; return(ResultFs.NotImplemented.Log()); }