FileStream: FileMode

FileMode

The modes in which to open a FileStream

 Public Enum FileMode

Values

CreateNew = 1
Creates a new file. If the file already exists, then an IOException is thrown.
Create = 2
Creates a new file. If the file already exists, it is overwritten.
OpenExisting = 3
Opens an existing file. If the file does not exist, then a FileNotFoundException is thrown.
OpenOrCreate = 4
Opens an existing file. If the file does not exist, it will be created.
Truncate = 5
Opens an existing file and sets the file length to 0. If an attempt to read is made, then an exception will be thrown.
Append = 6
Opens an existing or creates a new file, then moves to the end for writing to begin at. Reading of the stream is not supported.

See Also

Project CorLib Overview

Class FileStream Overview