FileFlags.this

Constructs the FileFlag with the given mode, access, and share attributes. These high-level flags are converted to the equivalent platform-specific flags that are needed when opening the file.

  1. this(Mode mode, Access access, Share share)
    struct FileFlags
    version(Posix)
    pure nothrow
    this
  2. this(Mode mode, Access access, Share share)
  3. this(string mode)

Parameters

mode Mode

Mode the file should be opened in. That is, to open, create, append, or truncate the file.

access Access

The permissions on the file stream. That is, read access, write access, or both.

share Share

The sharing permissions other processes are allowed on the file stream when trying to open the same file. By default, other processes are prevented from opening the file if they request read, write, or delete access. If you wish to allow other processes to read the file while it is open in this process, set this to Share.read. Currently only used by Windows.

Windows specific

The share parameter is currently only used by Windows.

Examples

immutable flags = FileFlags(Mode.open, Access.read);

Meta