GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::experimental::filesystem::current_path(3) C++ Standard Libary std::experimental::filesystem::current_path(3)

std::experimental::filesystem::current_path - std::experimental::filesystem::current_path


Defined in header <experimental/filesystem>
path current_path(); (1) (filesystem TS)
path current_path( error_code& ec ); (2) (filesystem TS)
void current_path( const path& p ); (3) (filesystem TS)
void current_path( const path& p, error_code& ec ); (4) (filesystem TS)


Returns or changes the current path.


1-2) Returns the absolute path of the current working directory, obtained as if by
POSIX getcwd. (2) returns path() if error occurs.
3-4) Changes the current working directory to p, as if by POSIX chdir.


p - path to change the current working directory to
ec - out-parameter for error reporting in the non-throwing overloads


1-2) Returns the current working directory.
3-4) (none)


1-2) The overload that does not take a error_code& parameter throws filesystem_error
on underlying OS API errors, constructed with the OS error code as the error code
argument. std::bad_alloc may be thrown if memory allocation fails. The overload
taking a error_code& parameter sets it to the OS API error code if an OS API call
fails, and executes ec.clear() if no errors occur. This overload has
noexcept specification:
noexcept
3-4) The overload that does not take a error_code& parameter throws filesystem_error
on underlying OS API errors, constructed with p as the first argument and the OS
error code as the error code argument. std::bad_alloc may be thrown if memory
allocation fails. The overload taking a error_code& parameter sets it to the OS API
error code if an OS API call fails, and executes ec.clear() if no errors occur. This
overload has
noexcept specification:
noexcept


The current working directory is the directory that is used as the starting location
in path resolution for relative paths. Single current working directory is
associated with entire process.


The current working directory is a dangerous global state of the program. Behavior
of various file input/output related functions are affected by the value of the
current path. The current path may be unexpectedly changed by any component of the
program, including various external libraries or other threads.


This section is incomplete

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.