You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibly due to C++20, there are now documented flags that force posix-compliant behavior on Windows when deleting a file. It is not documented when this was added to the Windows kernel. (It is also possible the behavior of DeleteFile and/or DeleteFileEx has changed according to random user comments on the internet, although the documentation for those functions still claim not to provide posix-behavior here.) But while browsing the documentation site, I discovered it is now possible to request posix-compatible deletion semantics via:
We can infer some of the dates where this is first available from the comments on the official C++20 STL implementation (apache-2 license), such as microsoft/STL#1559
It is then possible to detect the error if these functions/types are not available at runtime for the filesystem or operating system, and fallback to the current code.
The text was updated successfully, but these errors were encountered:
Possibly also a similar change for rename using SetFileInformationByHandle with FileRenameInfoEx and FILE_RENAME_FLAG_POSIX_SEMANTICS, though curiously the microsoft employees rejected using it to fix their stl bugs listed here microsoft/STL#2053 for being less-posix-compliant than our current implementation
Possibly due to C++20, there are now documented flags that force posix-compliant behavior on Windows when deleting a file. It is not documented when this was added to the Windows kernel. (It is also possible the behavior of DeleteFile and/or DeleteFileEx has changed according to random user comments on the internet, although the documentation for those functions still claim not to provide posix-behavior here.) But while browsing the documentation site, I discovered it is now possible to request posix-compatible deletion semantics via:
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/ns-ntddk-_file_disposition_information_ex
We can infer some of the dates where this is first available from the comments on the official C++20 STL implementation (apache-2 license), such as microsoft/STL#1559
1809 | Redstone 5 | October 2018 Update (added FILE_DISPOSITION_FLAG_IGNORE_READONLY_ATTRIBUTE)
1607 | Redstone | Anniversary Update (added FILE_DISPOSITION_FLAG_POSIX_SEMANTICS)
It is then possible to detect the error if these functions/types are not available at runtime for the filesystem or operating system, and fallback to the current code.
The text was updated successfully, but these errors were encountered: