Skip to content

Preserve and classify native Windows filesystem errors #523

Description

@LunaStev

The portable filesystem entry point promises negative errno-style failures, but the Windows implementation returns a constant -1 for most native API failures. Missing paths, denied access, invalid handles and sharing violations lose their identity before reaching callers. Substituting raw -GetLastError() everywhere would also be insufficient: Win32 codes and the portable errno domain are not interchangeable.

Source evidence at the head of #520:

Acceptance:

  • Capture GetLastError immediately after each failed filesystem API, before cleanup can overwrite it.
  • Centralize translation to the existing portable error convention; retain useful native detail where the error representation supports it.
  • Exercise missing file, denied operation, invalid handle and sharing conflict on native Windows; distinguish the returned errors.
  • Use native Windows APIs; do not add libc bindings.

Related: #385 is the provider umbrella; #508 concerns network errors and does not cover filesystem failures.

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