Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This version of Boost is under active development. You are currently in the develop branch. The current version is 1.91.0.
Open the file using the specified path.
void open( const std::string & path, file_base::flags open_flags, boost::system::error_code & ec);
This function opens the file so that it will use the specified path.
The path name identifying the file to be opened.
A set of flags that determine how the file should be opened.
Set to indicate what error occurred, if any.
Exactly one of the following file_base::flags
values must be specified:
The following flags may be bitwise or-ed in addition:
boost::asio::stream_file file(my_context); boost::system::error_code ec; file.open("/path/to/my/file", boost::asio::stream_file::read_only, ec); if (ec) { // An error occurred. }