Skip to content

Return real handle metadata from Windows fstat #524

Closed

Description

@LunaStev

Windows fstat obtains only the file size, then reports a regular-file mode and mtime = 0 for every successful call. The adjacent path-based stat reads actual attributes and last-write time. Querying the same ordinary file through a path and an open handle can therefore report different modification times, even without a concurrent change.

Source evidence at the head of #520:

Acceptance:

  • Populate size, type and modification time from native handle metadata, with the same units as path-based stat.
  • Compare stat/fstat for a nonempty temporary file with a known nonzero timestamp.
  • Handle directory and non-file handles explicitly; never fabricate regular-file metadata when unsupported.
  • Add native amd64 and ARM64 coverage without libc FFI.

Related: #385. Error translation is a separate concern from filling successful metadata.

Audit status: identified by static source inspection; the scenarios above have not been executed during this audit. The permalink fixes the reviewed revision; this report does not claim the defect was introduced by #520.

Activity

  1. added
    bug
    help wanted
    os-specific bug
    on Sep 8, 2026
  2. self-assigned this
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bughelp wantedos-specific bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions