Open
Description
Niall Douglas' "Racing the File System" at CppCon actually outlines a deletion algorithm that works correctly on Windows. It does not require retries.
The gist of it:
- Deletion is effectively asynchronous on Windows.
- If deleting recursively, you want to rename the item you're deleting out of the directory you're deleting first, then delete it.
This provides an alternative solution to the issue described in #96 and #108.
Alternative
It seems there's yet another way to do this using Windows 10 V1607's POSIX-compatible API:
SetFileInformationByHandle(FILE_DISPOSITION_INFO_EX { FILE_DISPOSITION_DELETE | FILE_DISPOSITION_POSIX_SEMANTICS })
But this is limited to NTFS.