コード例 #1
0
        public Result GetFileTimeStampRaw(out FileTimeStampRaw timeStamp, string path)
        {
            if (IsDisposed)
            {
                timeStamp = default;
                return(ResultFs.PreconditionViolation.Log());
            }

            return(GetFileTimeStampRawImpl(out timeStamp, path));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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()));
        }
コード例 #5
0
ファイル: LocalFileSystem.cs プロジェクト: roblabla/LibHac
        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);
        }
コード例 #6
0
 protected virtual Result GetFileTimeStampRawImpl(out FileTimeStampRaw timeStamp, string path)
 {
     timeStamp = default;
     return(ResultFs.NotImplemented.Log());
 }