2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-06 11:00:48 +00:00
restic/vendor/github.com/pkg/sftp/attrs_unix.go

18 lines
358 B
Go
Raw Normal View History

2018-09-03 18:23:56 +00:00
// +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris aix
2017-07-23 12:24:45 +00:00
// +build cgo
package sftp
import (
"os"
"syscall"
)
func fileStatFromInfoOs(fi os.FileInfo, flags *uint32, fileStat *FileStat) {
if statt, ok := fi.Sys().(*syscall.Stat_t); ok {
*flags |= ssh_FILEXFER_ATTR_UIDGID
fileStat.UID = statt.Uid
fileStat.GID = statt.Gid
}
}