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.
Constructs the file flags from a mode string.
Parses an fopen-style mode string such as "r+". All possible mode strings include:
An existing file is opened with read access. This is likely the most commonly used set of flags.
A new file is either opened or created with read/write access.
A new file is either opened or created, truncated if necessary, with read/write access. This ensures that an empty file is opened.
An existing file is opened with read/write access.
A new file is created with read/write access. Fails if the file already exists.
A new file is either opened or created with write access.
A new file is either opened or created, truncated if necessary, with write access. This ensures that an empty file is opened.
An existing file is opened with write access.
A new file is created with write access. Fails if the file already exists.
// Creates the file "foobar", truncates it, and opens it in write-only mode auto f = File("foobar", FileFlags.writeEmpty);
io.file.stream
File flags that determine how a file stream is created and used.
Since all methods in this struct are pure, the high-level configuration flags given here are converted to the platform-specific file flags at compile time.