Skip to content

Commit cad3244

Browse files
committed
Implementing default getOSFileInfo implementation for other platforms
1 parent 7a961c1 commit cad3244

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

file/file_other.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//go:build !windows && !darwin && !dragonfly && !freebsd && !linux && !nacl && !netbsd && !openbsd && !solaris
2+
3+
package file
4+
5+
import (
6+
"os"
7+
"syscall"
8+
)
9+
10+
func getOSFileInfo(info os.FileInfo) *FileInfo {
11+
fi := &FileInfo{}
12+
if s, ok := info.Sys().(*syscall.Stat_t); ok {
13+
fi.Nlink = uint32(s.Nlink)
14+
fi.UID = s.Uid
15+
fi.GID = s.Gid
16+
fi.Fileid = s.Ino
17+
return fi
18+
}
19+
return nil
20+
}

0 commit comments

Comments
 (0)