...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
File open modes.
Defined in header <boost/beast/core/file_base.hpp>
enum file_mode
Name |
Description |
---|---|
|
Random read-only access to an existing file. |
|
Sequential read-only access to an existing file. |
|
Random reading and writing to a new or truncated file. This mode permits random-access reading and writing for the specified file. If the file does not exist prior to the function call, it is created with an initial size of zero bytes. Otherwise if the file already exists, the size is truncated to zero bytes. |
|
Random reading and writing to a new file only. This mode permits random-access reading and writing for the specified file. The file will be created with an initial size of zero bytes. If the file already exists prior to the function call, an error is returned and no file is opened. |
|
Random write-only access to existing file. If the file does not exist, an error is generated. |
|
Appending to a new or truncated file. The current file position shall be set to the end of the file prior to each write. @li If the file does not exist, it is created. @li If the file exists, it is truncated to zero size upon opening. |
|
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. |
These modes are used when opening files using instances of the File concept.