Skip to content

Commit f2f4730

Browse files
committed
Document that create_dir_all calls mkdir/CreateDirW multiple times
1 parent 9084601 commit f2f4730

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

library/std/src/fs.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,7 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
22582258
/// # Platform-specific behavior
22592259
///
22602260
/// This function currently corresponds to the `mkdir` function on Unix
2261-
/// and the `CreateDirectory` function on Windows.
2261+
/// and the `CreateDirectoryW` function on Windows.
22622262
/// Note that, this [may change in the future][changes].
22632263
///
22642264
/// [changes]: io#platform-specific-behavior
@@ -2300,8 +2300,12 @@ pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
23002300
///
23012301
/// # Platform-specific behavior
23022302
///
2303-
/// This function currently corresponds to the `mkdir` function on Unix
2304-
/// and the `CreateDirectory` function on Windows.
2303+
/// This function currently correspond to calling the directory creation
2304+
/// function for each of the components of the path, starting from the right
2305+
/// and going to the right again after the first successful call. The directory
2306+
/// creation function used on Unix is `mkdir` and `CreateDirectoryW` on
2307+
/// Windows.
2308+
///
23052309
/// Note that, this [may change in the future][changes].
23062310
///
23072311
/// [changes]: io#platform-specific-behavior

0 commit comments

Comments
 (0)