implement Fileinfo for Windows and non-Windows

This commit is contained in:
Yasuhiro Matsumoto
2022-05-13 09:51:46 +09:00
committed by Ben Johnson
parent e9dbf83a45
commit 4522c7bce5
3 changed files with 29 additions and 9 deletions

View File

@@ -176,15 +176,6 @@ func MkdirAll(path string, mode os.FileMode, uid, gid int) error {
return nil
}
// Fileinfo returns syscall fields from a FileInfo object.
func Fileinfo(fi os.FileInfo) (uid, gid int) {
if fi == nil {
return -1, -1
}
stat := fi.Sys().(*syscall.Stat_t)
return int(stat.Uid), int(stat.Gid)
}
// ParseSnapshotPath parses the index from a snapshot filename. Used by path-based replicas.
func ParseSnapshotPath(s string) (index int, err error) {
a := snapshotPathRegex.FindStringSubmatch(s)