std: mention remove_dir_all can emit DirectoryNotEmpty when concurrently written into

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
xizheyin 2025-04-20 14:32:33 +08:00
parent f433fa46b0
commit 3a372e39ca
No known key found for this signature in database
GPG key ID: 0A0D90BE99CEDEAD

View file

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