Skip to content

Return real handle metadata from Windows fstat #524

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.os-specific bugA bug or issue that occurs only on a specific operating system.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions