Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::FileOpen Struct Reference

Options used to open a file descriptor. More...

#include <FileDescriptor.h>

Public Types

enum  Mode : uint8_t {
  Read = 0 ,
  ReadWrite ,
  Append ,
  AppendRead ,
  Write ,
  WriteRead
}
 Indicates the mode in which the file should be opened (read, write, append, etc.) More...
 

Public Member Functions

 FileOpen (Mode mode=Read)
 
int toPosixFlags () const
 
int toPosixAccess () const
 

Public Attributes

Mode mode
 Open mode (read, write, append, etc.). See FileOpen::Mode for more details.
 
bool inheritable = false
 Set to true to make the file visible to child processes.
 
bool blocking = true
 Set to false if file will be used for Async I/O (see Async)
 
bool sync = false
 Set to true to open file in synchronous mode, bypassing local file system cache.
 
bool exclusive = false
 Set to true to fail if the file already exists (like 'x' flag in fopen)
 

Detailed Description

Options used to open a file descriptor.

Member Enumeration Documentation

◆ Mode

Indicates the mode in which the file should be opened (read, write, append, etc.)

Enumerator
Read 

r Open for reading. An error occurs if the file does not exist.

ReadWrite 

r+ Open for reading and writing. An error occurs if the file does not exist.

Append 

a Open for appending. The file is created if it does not exist.

AppendRead 

a+ Open for reading and appending. The file is created if it does not exist.

Write 

w Open for writing. The file is created (if it does not exist) or truncated (if it exists).

WriteRead 

w+ Open for reading and writing. The file is created (if it does not exist) or truncated.

Member Data Documentation

◆ blocking

bool SC::FileOpen::blocking = true

Set to false if file will be used for Async I/O (see Async)

◆ exclusive

bool SC::FileOpen::exclusive = false

Set to true to fail if the file already exists (like 'x' flag in fopen)

◆ inheritable

bool SC::FileOpen::inheritable = false

Set to true to make the file visible to child processes.

◆ mode

Mode SC::FileOpen::mode

Open mode (read, write, append, etc.). See FileOpen::Mode for more details.

◆ sync

bool SC::FileOpen::sync = false

Set to true to open file in synchronous mode, bypassing local file system cache.


The documentation for this struct was generated from the following file: