-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<filesystem>: remove does not delete read-only files #1511
Comments
Bug confirmed. I assume we could fix this by clearing the read-only attribute and retrying when access is denied, but hopefully there's a more elegant way. |
I think we should try and clear the read-only attribute before setting FILE_FLAG_DELETE_ON_CLOSE. In this way we avoid retrying for the failure case. |
I expect |
If I understand correctly, the file is being deleted when the destructor for |
This is not completely fixed. |
Such files are indeed readonly, so I'll reactivate this bug:
|
Hey, I am trying to debug this. But the objects inside the git folder are getting deleted with |
Descibe the bug
std::filesystem::remove() does not remove read-only files
The issue with this is that STL sets the FILE_ATTRIBUTE_READONLY bit when we remove the write permissions for a file.
remove should remove such files also.
Command-line test case
Expected behavior
std::filesystem::remove() should remove 'testfile'
STL version
Versions that support std::filesystem
The text was updated successfully, but these errors were encountered: