GenZmeY
702cd21256
- fix inplace arg - follow symlinks by default - reverse flag - quiet flag - try chown/chmod on unix
18 lines
229 B
Go
18 lines
229 B
Go
// +build !windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func GetUidGid(info os.FileInfo) (int, int) {
|
|
stat, ok := info.Sys().(*syscall.Stat_t)
|
|
if ok {
|
|
return int(stat.Uid), int(stat.Gid)
|
|
} else {
|
|
return -1, -1
|
|
}
|
|
}
|