Skip to content

stat silently falls back to mtime for atime/ctime on unsupported platforms with no indication #19

@github-actions

Description

@github-actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions