System::IO::FileMode enum

FileMode enum

Specifies how a file should be opened.

enum class FileMode

Values

NameValueDescription
CreateNew1Create a new file. If the file already exists, an exception is thrown.
Create2Create a new file. If the file already exists, it is overwritten.
Open3Open an existing file. If the file does not exist, an exception is thrown.
OpenOrCreate4Open an existing file or create a new one if it does not exist.
Truncate5Open an existing file and truncate it so that it is empty. If the file does not exist, an exception is thrown.
Append6Open an existing file and seek to the end of it or create a new one if it does not exist.

See Also