Mono Class Library: System.IO Namespace

System.IO.FileMode Enumeration

Specifies how the operating system opens a file. [Edit]
[System.Runtime.InteropServices.ComVisible(true)]
public enum FileMode

Remarks

System.IO.FileMode values specify whether a file is created if one does not exist, and determine whether the contents of existing files are retained or overwritten. [Edit]

Members

Member NameDescription
Append Requests a file be opened. If the file exists, its contents are preserved. This value is valid only for FileAccess.Write access. Attempts to read from a file opened with Append cause an exception. [Edit]
Create Requests a new file be created if it does not exist. The file contents are overwritten if it does exist. This value is equivalent to requesting that if the file does not exist, use FileMode.CreateNew; otherwise, use FileMode.Truncate. [Edit]
CreateNew Requests a new file be created. An exception is thrown if the file already exists. [Edit]
OpenRequests an existing file be opened. An exception is thrown if the file does not exist. [Edit]
OpenOrCreate Requests a file be opened. The file is created if it does not exist. [Edit]
Truncate Requests an existing file be opened; existing contents are deleted. This value is valid only for FileAccess.Write access. Attempts to read from a file opened with Truncate cause an exception. [Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0