Skip to content

Conversation

compnerd
Copy link
Member

We have observed ERROR_ACCESS_DENIED in CI on
SetRenameInformationFile. Try to make the path more robust by first performing a kernel based rename with POSIX semantics. This requires Windows 10 1809+. If that is unsuccessful, verify that attributes are not to blame.

A failure may still occur if the file is on a different volume. In such a case, fallback to the MoveFileExW operation to perform a copy + delete operation.

Hopefully this should make the implementation more robust to failures.

We have observed `ERROR_ACCESS_DENIED` in CI on
`SetRenameInformationFile`. Try to make the path more robust by first
performing a kernel based rename with POSIX semantics. This requires
Windows 10 1809+. If that is unsuccessful, verify that attributes are
not to blame.

A failure may still occur if the file is on a different volume. In such
a case, fallback to the `MoveFileExW` operation to perform a copy +
delete operation.

Hopefully this should make the implementation more robust to failures.
@compnerd compnerd requested a review from jmschonfeld August 29, 2025 01:16
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd requested review from parkera and bnbarham August 29, 2025 01:16
@bnbarham bnbarham changed the base branch from main to release/6.2 August 29, 2025 17:24
@bnbarham bnbarham changed the title FoundationEssentials: try to make the file atomic behaviour more robust [6.2] Use SetFileInformationByHandle for rename in atomic Data.write on Windows Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant