document remove_dir_all returning DirectoryNotEmpty on concurrent write #139958
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
A-filesystem
Area: `std::fs`
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Location
https://doc.rust-lang.org/std/fs/fn.remove_dir_all.html
Summary
remove_dir_all
can fail withDirectoryNotEmpty
. This is somewhat implied by this sentence:but when diagnosing an issue related to this function, it really didn't seem to me that
DirectoryNotEmpty
was an error this function could ever return, especially given the detailed error section, and a platform-specific section mentioning being TOCTOU free (note: i wouldn't consider this a TOCTOU vuln by any mean, but it implied to me a stronger kind of handling for concurrent access than there is).error reproducer:
I think the last line of the Error section could be rewritten as:
The text was updated successfully, but these errors were encountered: