tmp/tmp0uf1xja8/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:* Creates the directory `p` resolves to, as if by POSIX `mkdir`
|
| 9 |
+
with a second argument of `static_cast<int>(perms::all)`. If `mkdir`
|
| 10 |
+
fails because `p` resolves to an existing directory, no error is
|
| 11 |
+
reported. Otherwise on failure an error is reported.
|
| 12 |
+
|
| 13 |
+
*Returns:* `true` if a new directory was created, otherwise `false`.
|
| 14 |
+
|
| 15 |
+
*Throws:* As specified in [[fs.err.report]].
|
| 16 |
+
|
| 17 |
+
``` cpp
|
| 18 |
+
bool create_directory(const path& p, const path& existing_p);
|
| 19 |
+
bool create_directory(const path& p, const path& existing_p, error_code& ec) noexcept;
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
*Effects:* Creates the directory `p` resolves to, with attributes copied
|
| 23 |
+
from directory `existing_p`. The set of attributes copied is operating
|
| 24 |
+
system dependent. If `mkdir` fails because `p` resolves to an existing
|
| 25 |
+
directory, no error is reported. Otherwise on failure an error is
|
| 26 |
+
reported.
|
| 27 |
+
|
| 28 |
+
[*Note 1*: For POSIX-based operating systems, the attributes are those
|
| 29 |
+
copied by native API `stat(existing_p.c_str(), &attributes_stat)`
|
| 30 |
+
followed by `mkdir(p.c_str(), attributes_stat.st_mode)`. For
|
| 31 |
+
Windows-based operating systems, the attributes are those copied by
|
| 32 |
+
native API
|
| 33 |
+
`CreateDirectoryExW(existing_p.c_str(), p.c_str(), 0)`. — *end note*]
|
| 34 |
+
|
| 35 |
+
*Returns:* `true` if a new directory was created with attributes copied
|
| 36 |
+
from directory `existing_p`, otherwise `false`.
|
| 37 |
+
|
| 38 |
+
*Throws:* As specified in [[fs.err.report]].
|
| 39 |
+
|