file_util_non_posix.go 322 B

12345678910111213
  1. //go:build linux || darwin || freebsd || netbsd || openbsd || plan9 || solaris || zos
  2. // +build linux darwin freebsd netbsd openbsd plan9 solaris zos
  3. package util
  4. import (
  5. "os"
  6. "syscall"
  7. )
  8. func GetFileUidGid(fi os.FileInfo) (uid, gid uint32) {
  9. return fi.Sys().(*syscall.Stat_t).Uid, fi.Sys().(*syscall.Stat_t).Gid
  10. }