-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std.windows: use atomic rename, if possible #16717
Conversation
This should use the same strategy as #16499, since the same caveat (presumably) applies for non-NTFS filesystems. |
CI passes now. Do you think further tests are needed @squeek502 ? |
Would be good to test to confirm that this will actually mitigate #14978 (see the reproduction in #14978 (comment)) |
I can confirm that the fallback works--the fs tests pass when running on a FAT32 drive (and I confirmed that |
I can also confirm that this successfully avoids
(there is a second process of the same Once #16717 (comment) is addressed, I think this will be good to go. |
2ba09bc
to
1cbb003
Compare
Also add optimization for happy path with early return. No idea, why this worked before.
1cbb003
to
1466712
Compare
Most of these tests were made to pass by ziglang#16717, but there were a few loose ends to tie up with regards to the 'fallback' behavior (when FILE_RENAME_POSIX_SEMANTICS either isn't available or isn't supported by the underlying filesystem). We now do a bit of extra work to get POSIX-like renaming in the fallback path. Closes ziglang#6364
Mitigates #14978.