mirror of
https://github.com/genuinetools/reg.git
synced 2024-08-21 14:20:23 -04:00
19 lines
310 B
Go
19 lines
310 B
Go
// +build !windows
|
|
|
|
package fs
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func getLinkInfo(fi os.FileInfo) (uint64, bool) {
|
|
s, ok := fi.Sys().(*syscall.Stat_t)
|
|
if !ok {
|
|
return 0, false
|
|
}
|
|
|
|
// Ino is uint32 on bsd, uint64 on darwin/linux/solaris
|
|
return uint64(s.Ino), !fi.IsDir() && s.Nlink > 1 // nolint: unconvert
|
|
}
|