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 an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

file_mode

File open modes.

Synopsis

Defined in header <boost/beast/core/file_base.hpp>

enum file_mode

Values

Name

Description

read

Random reading.

scan

Sequential reading.

write

Random writing to a new or truncated file.

If the file does not exist, it is created. If the file exists, it is truncated to zero size upon opening.

write_new

Random writing to new file only.

If the file exists, an error is generated.

write_existing

Random writing to existing file.

If the file does not exist, an error is generated.

append

Appending to a new or truncated file.

The current file position shall be set to the end of the file prior to each write.If the file does not exist, it is created. If the file exists, it is truncated to zero size upon opening.

append_new

Appending to a new file only.

The current file position shall be set to the end of the file prior to each write.If the file exists, an error is generated.

append_existing

Appending to an existing file.

The current file position shall be set to the end of the file prior to each write.If the file does not exist, an error is generated.

Description

These modes are used when opening files using instances of the File concept.

See Also

file_stdio

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext