diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-11-02 18:23:51 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-11-04 12:37:43 +0100 |
| commit | 424fecdfb612f82527d8b74be3510b2171d0f5b3 (patch) | |
| tree | 8d540a7f5b6f7b2fc0393098424406c16f33780e /src/libstd | |
| parent | 5ea8eb55cd9f4547b332f43c9f723de30187c223 (diff) | |
| download | rust-424fecdfb612f82527d8b74be3510b2171d0f5b3.tar.gz rust-424fecdfb612f82527d8b74be3510b2171d0f5b3.zip | |
Add precision for create_dir function
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fs.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 017949291bc..49012a7d341 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1755,12 +1755,19 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> { /// /// [changes]: ../io/index.html#platform-specific-behavior /// +/// **NOTE**: If a parent of the given path doesn't exist, this function will +/// return an error. To create a directory and all its missing parents at the +/// same time, use the [`create_dir_all`] function. +/// /// # Errors /// /// This function will return an error in the following situations, but is not /// limited to just these cases: /// /// * User lacks permissions to create directory at `path`. +/// * A parent of the given path doesn't exist. (To create a directory and all +/// its missing parents at the same time, use the [`create_dir_all`] +/// function.) /// * `path` already exists. /// /// # Examples |
