Enum FileOpenModeFlags to select the open mode of a File or external string.
Flags to select the open mode of a File or external string.
Defined in | <seqan/file.h> |
---|---|
Signature |
|
Enum Values
OPEN_RDONLY |
Open in read-only mode.
|
---|---|
OPEN_WRONLY |
Open in write-only mode.
|
OPEN_RDWR |
Open for reading and writing.
|
OPEN_CREATE |
Create the file if it does not yet exists.
|
OPEN_APPEND |
Keep the existing data. If this flag is not given then the file is cleared in write mode.
|
OPEN_QUIET |
Don't print any warning message if the file could not be opened.
|
OPEN_MASK |
(Internal) Bitmask to extract the read/write open mode.
|
OPEN_ASYNC |
(Internal) Open the file for asynchronous file access. For asynchronous file access, use the AsyncFile.
|
OPEN_TEMPORARY |
(Internal) Open automatically delete the file after close. Use the openTemp methods to open
temporary files.
|
Detailed Description
These flags can be combined via the | operator (bitwise OR). The defualt open mode is OPEN_RDWR | OPEN_CREATE | OPEN_APPEND.
If you omit the OPEN_APPEND flag in write mode, the file will be truncated to size 0 when opened.
Examples
Code example to test for read-only mode:
if (openMode & OPEN_MASK == OPEN_READ)
// do something if opened in read-only mode