idun/vendor/github.com/pkg/sftp/ls_unix.go
Renovate Bot cc69014892
Some checks failed
Dev Version / Release (push) Has been cancelled
chore(deps): update module github.com/pkg/sftp to v1.13.7
2024-10-23 18:10:37 +00:00

24 lines
539 B
Go

//go:build aix || darwin || dragonfly || freebsd || (!android && linux) || netbsd || openbsd || solaris || js || zos
// +build aix darwin dragonfly freebsd !android,linux netbsd openbsd solaris js zos
package sftp
import (
"os"
"syscall"
)
func lsLinksUIDGID(fi os.FileInfo) (numLinks uint64, uid, gid string) {
numLinks = 1
uid, gid = "0", "0"
switch sys := fi.Sys().(type) {
case *syscall.Stat_t:
numLinks = uint64(sys.Nlink)
uid = lsFormatID(sys.Uid)
gid = lsFormatID(sys.Gid)
default:
}
return numLinks, uid, gid
}