about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2024-04-29 21:22:34 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2024-04-29 21:22:34 +0200
commita0f8ada69e33faf877f6f87d417dcd575e470a62 (patch)
tree7304bdeaa246e11b8e76180e619b3d80873a200a /library/std/src
parent90846015cc99aa90290c1f4ee95c571fff6901ef (diff)
downloadrust-a0f8ada69e33faf877f6f87d417dcd575e470a62.tar.gz
rust-a0f8ada69e33faf877f6f87d417dcd575e470a62.zip
Document that `create_dir_all` calls `mkdir`/`CreateDirW` multiple times
Also mention that there might be leftover directories in the error case.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/fs.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs
index 409ead0e284..a59faf551e8 100644
--- a/library/std/src/fs.rs
+++ b/library/std/src/fs.rs
@@ -2258,7 +2258,7 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
 /// # Platform-specific behavior
 ///
 /// This function currently corresponds to the `mkdir` function on Unix
-/// and the `CreateDirectory` function on Windows.
+/// and the `CreateDirectoryW` function on Windows.
 /// Note that, this [may change in the future][changes].
 ///
 /// [changes]: io#platform-specific-behavior
@@ -2298,10 +2298,14 @@ pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
 /// Recursively create a directory and all of its parent components if they
 /// are missing.
 ///
+/// If this function returns an error, some of the parent components might have
+/// been created already.
+///
 /// # Platform-specific behavior
 ///
-/// This function currently corresponds to the `mkdir` function on Unix
-/// and the `CreateDirectory` function on Windows.
+/// This function currently corresponds to multiple calls to the `mkdir`
+/// function on Unix and the `CreateDirectoryW` function on Windows.
+///
 /// Note that, this [may change in the future][changes].
 ///
 /// [changes]: io#platform-specific-behavior