Skip to content

Commit 3a372e3

Browse files
committed
std: mention remove_dir_all can emit DirectoryNotEmpty when concurrently written into
Signed-off-by: xizheyin <[email protected]>
1 parent f433fa4 commit 3a372e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2874,6 +2874,8 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
28742874
///
28752875
/// Consider ignoring the error if validating the removal is not required for your use case.
28762876
///
2877+
/// This function may return [`io::ErrorKind::DirectoryNotEmpty`] if the directory is concurrently
2878+
/// written into, which typically indicates some contents were removed but not all.
28772879
/// [`io::ErrorKind::NotFound`] is only returned if no removal occurs.
28782880
///
28792881
/// [`fs::remove_file`]: remove_file

0 commit comments

Comments
 (0)