package mac import ( "io/fs" "syscall" ) // fileKey names one state of one file: its device and inode, size, // modification and change times. The change time moves on any write, // chmod or rename, and no process can set it back. func fileKey(fi fs.FileInfo) (statKey, bool) { st, ok := fi.Sys().(*syscall.Stat_t) if !ok { return statKey{}, false } return statKey{dev: uint64(st.Dev), ino: uint64(st.Ino), size: st.Size, mtime: st.Mtim.Nano(), ctime: st.Ctim.Nano()}, true } // fileOwner is the uid that owns fi (-1 when unknown). func fileOwner(fi fs.FileInfo) int { if st, ok := fi.Sys().(*syscall.Stat_t); ok { return int(st.Uid) } return -1 }