/* Nanosecond-precision lstat for the working-tree walk. * * V's `os.Stat` exposes mtime and ctime in whole seconds. The file cache in * `src/snapshot` decides whether a file may skip hashing by comparing those * timestamps, so second precision would let a file edited twice inside one * second keep a stale hash — and a save would then record the wrong content. * This shim reports nanoseconds, plus the file kind, which the walker needs to * skip symlinks and directories without a second stat call. */ #ifndef KOH_STAT_H #define KOH_STAT_H typedef struct koh_stat { long long size; long long mtime_ns; long long ctime_ns; unsigned int mode; int kind; /* 0 missing, 1 file, 2 dir, 3 symlink, 4 other */ } koh_stat; /* Fills `out`; returns 1 on success, 0 when the path cannot be lstat'ed. */ int koh_lstat(const char *path, koh_stat *out); #endif