File size: 290 Bytes
d2507b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | //go:build unix
package compactscan
import (
"fmt"
"os"
"syscall"
)
func openedHardLinkCount(_ *os.File, info os.FileInfo) (uint64, error) {
stat, ok := info.Sys().(*syscall.Stat_t)
if !ok {
return 0, fmt.Errorf("hard-link count unavailable")
}
return uint64(stat.Nlink), nil
}
|