31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.13 Filesystem operation functions [fs.op.funcs]

31.12.13.12 Current path [fs.op.current.path]

path filesystem::current_path(); path filesystem::current_path(error_code& ec);
Returns: The absolute path of the current working directory, whose pathname in the native format is obtained as if by POSIX getcwd.
The signature with argument ec returns path() if an error occurs.
Remarks: The current working directory is the directory, associated with the process, that is used as the starting location in pathname resolution for relative paths.
[Note 1: 
The current path as returned by many operating systems is a dangerous global variable and can be changed unexpectedly by third-party or system library functions, or by another thread.
— end note]
void filesystem::current_path(const path& p); void filesystem::current_path(const path& p, error_code& ec) noexcept;
Throws: As specified in [fs.err.report].
[Note 2: 
The current path for many operating systems is a dangerous global state and can be changed unexpectedly by third-party or system library functions, or by another thread.
— end note]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant