diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 15:16:55 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 15:16:55 +0200 |
| commit | 0b5d0eb92c5be2f0ddb2fa73990f31e5654e57fe (patch) | |
| tree | 358e331945b8206ed4a72703e3aedfe8ea7cdcdb /internal/scan/fileid_unix.go | |
| parent | 1d3f2d1e4c59867024470d3444e12698b7ebb22e (diff) | |
| download | krino-0.0.5.tar.gz krino-0.0.5.zip | |
krino: 0.0.5 — keyword cache, t and d in reviewv0.0.5
Diffstat (limited to 'internal/scan/fileid_unix.go')
| -rw-r--r-- | internal/scan/fileid_unix.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/scan/fileid_unix.go b/internal/scan/fileid_unix.go new file mode 100644 index 0000000..e29066a --- /dev/null +++ b/internal/scan/fileid_unix.go @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +//go:build unix + +package scan + +import ( + "io/fs" + "syscall" +) + +// fileID returns the device and inode info was read from. +func fileID(info fs.FileInfo) (dev, ino uint64) { + st, ok := info.Sys().(*syscall.Stat_t) + if !ok { + return 0, 0 + } + return uint64(st.Dev), uint64(st.Ino) +} |
