| //go:build windows | |
| package compactonnx | |
| import ( | |
| "os" | |
| "syscall" | |
| ) | |
| func openedHardLinkCount(file *os.File, _ os.FileInfo) (uint64, error) { | |
| var info syscall.ByHandleFileInformation | |
| if err := syscall.GetFileInformationByHandle(syscall.Handle(file.Fd()), &info); err != nil { | |
| return 0, err | |
| } | |
| return uint64(info.NumberOfLinks), nil | |
| } | |