Description
In tools/stat/stat.go, getATimSec, getMTimSec, getCTimSec use nested interface type assertions. When the platform's syscall.Stat_t doesn't expose the expected method signatures (macOS, Windows), all three functions return 0 silently, causing the code to fall back to info.ModTime().
The result is that atime, mtime, and ctime in the XML output all show identical values with no signal to the consumer that this is a fallback.
Expected Behavior
Add a platform_fallback="true" attribute on the <stat> element when syscall-level timestamps are unavailable, so consumers can handle the ambiguity correctly.
Actual Behavior
All three timestamps are identical and equal to mtime, no indication that the values are approximations.
Affected Platforms
- macOS (partial —
Atimespec/Mtimespec differ from Linux Atim/Mtim)
- Windows (no syscall timestamp fields)
Related
tools/stat/stat.go getATimSec, getMTimSec, getCTimSec
Description
In
tools/stat/stat.go,getATimSec,getMTimSec,getCTimSecuse nested interface type assertions. When the platform'ssyscall.Stat_tdoesn't expose the expected method signatures (macOS, Windows), all three functions return0silently, causing the code to fall back toinfo.ModTime().The result is that
atime,mtime, andctimein the XML output all show identical values with no signal to the consumer that this is a fallback.Expected Behavior
Add a
platform_fallback="true"attribute on the<stat>element when syscall-level timestamps are unavailable, so consumers can handle the ambiguity correctly.Actual Behavior
All three timestamps are identical and equal to
mtime, no indication that the values are approximations.Affected Platforms
Atimespec/Mtimespecdiffer from LinuxAtim/Mtim)Related
tools/stat/stat.gogetATimSec,getMTimSec,getCTimSec