From Jason Turner

[fs.op.current_path]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpiv280nxd/{from.md → to.md} +41 -0
tmp/tmpiv280nxd/{from.md → to.md} RENAMED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Current path <a id="fs.op.current_path">[[fs.op.current_path]]</a>
2
+
3
+ ``` cpp
4
+ path current_path();
5
+ path current_path(error_code& ec);
6
+ ```
7
+
8
+ *Returns:* The absolute path of the current working directory, whose
9
+ pathname in the native format is obtained as if by POSIX `getcwd()`. The
10
+ signature with argument `ec` returns `path()` if an error occurs.
11
+
12
+ *Throws:* As specified in  [[fs.err.report]].
13
+
14
+ *Remarks:* The current working directory is the directory, associated
15
+ with the process, that is used as the starting location in pathname
16
+ resolution for relative paths.
17
+
18
+ [*Note 1*: The `current_path()` name was chosen to emphasize that the
19
+ returned value is a path, not just a single directory
20
+ name. — *end note*]
21
+
22
+ [*Note 2*: The current path as returned by many operating systems is a
23
+ dangerous global variable. It may be changed unexpectedly by a
24
+ third-party or system library functions, or by another
25
+ thread. — *end note*]
26
+
27
+ ``` cpp
28
+ void current_path(const path& p);
29
+ void current_path(const path& p, error_code& ec) noexcept;
30
+ ```
31
+
32
+ *Effects:* Establishes the postcondition, as if by POSIX `chdir()`.
33
+
34
+ *Postconditions:* `equivalent(p, current_path())`.
35
+
36
+ *Throws:* As specified in  [[fs.err.report]].
37
+
38
+ [*Note 3*: The current path for many operating systems is a dangerous
39
+ global state. It may be changed unexpectedly by a third-party or system
40
+ library functions, or by another thread. — *end note*]
41
+