k3s/vendor/github.com/lxc/lxd/shared/util_unix.go

16 lines
269 B
Go
Raw Normal View History

2019-11-08 21:45:10 +00:00
// +build !windows
package shared
import (
"os"
"syscall"
)
func GetOwnerMode(fInfo os.FileInfo) (os.FileMode, int, int) {
mode := fInfo.Mode()
uid := int(fInfo.Sys().(*syscall.Stat_t).Uid)
gid := int(fInfo.Sys().(*syscall.Stat_t).Gid)
return mode, uid, gid
}