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 is the documentation for a snapshot of the develop branch, built from commit d7c8a7cf0d.
PrevUpHomeNext
basic_random_access_file::open (1 of 4 overloads)

Inherited from basic_file.

Open the file using the specified path.

void open(
    const char * path,
    file_base::flags open_flags);

This function opens the file so that it will use the specified path.

Parameters

path

The path name identifying the file to be opened.

open_flags

A set of flags that determine how the file should be opened.

Exceptions

boost::system::system_error

Thrown on failure.

Example
boost::asio::stream_file file(my_context);
file.open("/path/to/my/file", boost::asio::stream_file::read_only);

PrevUpHomeNext