File: attrs_unix.go

package info (click to toggle)
golang-github-pkg-sftp 0.0~git20160930.0.4d0e916-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 320 kB
  • ctags: 585
  • sloc: makefile: 5
file content (17 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris
// +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
	}
}