tmp/tmppx4wpsuy/{from.md → to.md}
RENAMED
|
@@ -1,44 +0,0 @@
|
|
| 1 |
-
#### Create directory <a id="fs.op.create_directory">[[fs.op.create_directory]]</a>
|
| 2 |
-
|
| 3 |
-
``` cpp
|
| 4 |
-
bool create_directory(const path& p);
|
| 5 |
-
bool create_directory(const path& p, error_code& ec) noexcept;
|
| 6 |
-
```
|
| 7 |
-
|
| 8 |
-
*Effects:* Establishes the postcondition by attempting to create the
|
| 9 |
-
directory `p` resolves to, as if by POSIX `mkdir()` with a second
|
| 10 |
-
argument of `static_cast<int>(perms::all)`. Creation failure because `p`
|
| 11 |
-
resolves to an existing directory shall not be treated as an error.
|
| 12 |
-
|
| 13 |
-
*Postconditions:* `is_directory(p)`.
|
| 14 |
-
|
| 15 |
-
*Returns:* `true` if a new directory was created, otherwise `false`. The
|
| 16 |
-
signature with argument `ec` returns `false` if an error occurs.
|
| 17 |
-
|
| 18 |
-
*Throws:* As specified in [[fs.err.report]].
|
| 19 |
-
|
| 20 |
-
``` cpp
|
| 21 |
-
bool create_directory(const path& p, const path& existing_p);
|
| 22 |
-
bool create_directory(const path& p, const path& existing_p, error_code& ec) noexcept;
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
*Effects:* Establishes the postcondition by attempting to create the
|
| 26 |
-
directory `p` resolves to, with attributes copied from directory
|
| 27 |
-
`existing_p`. The set of attributes copied is operating system
|
| 28 |
-
dependent. Creation failure because `p` resolves to an existing
|
| 29 |
-
directory shall not be treated as an error.
|
| 30 |
-
|
| 31 |
-
[*Note 1*: For POSIX-based operating systems, the attributes are those
|
| 32 |
-
copied by native API `stat(existing_p.c_str(), &attributes_stat)`
|
| 33 |
-
followed by `mkdir(p.c_str(), attributes_stat.st_mode)`. For
|
| 34 |
-
Windows-based operating systems, the attributes are those copied by
|
| 35 |
-
native API
|
| 36 |
-
`CreateDirectoryExW(existing_p.c_str(), p.c_str(), 0)`. — *end note*]
|
| 37 |
-
|
| 38 |
-
*Postconditions:* `is_directory(p)`.
|
| 39 |
-
|
| 40 |
-
*Returns:* `true` if a new directory was created, otherwise `false`. The
|
| 41 |
-
signature with argument `ec` returns `false` if an error occurs.
|
| 42 |
-
|
| 43 |
-
*Throws:* As specified in [[fs.err.report]].
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|