using System; using System.Runtime.InteropServices; using Cpp2IlInjected; namespace System.IO { /// Specifies how the operating system should open a file. // Token: 0x020002B8 RID: 696 [Token(Token = "0x20002B8")] [ComVisible(true)] [Serializable] public enum FileMode { /// Specifies that the operating system should create a new file. This requires permission. If the file already exists, an exception is thrown. // Token: 0x04000D77 RID: 3447 [Token(Token = "0x4000D77")] CreateNew = 1, /// Specifies that the operating system should create a new file. If the file already exists, it will be overwritten. This requires permission. is equivalent to requesting that if the file does not exist, use ; otherwise, use . If the file already exists but is a hidden file, an exception is thrown. // Token: 0x04000D78 RID: 3448 [Token(Token = "0x4000D78")] Create, /// Specifies that the operating system should open an existing file. The ability to open the file is dependent on the value specified by the enumeration. A exception is thrown if the file does not exist. // Token: 0x04000D79 RID: 3449 [Token(Token = "0x4000D79")] Open, /// Specifies that the operating system should open a file if it exists; otherwise, a new file should be created. If the file is opened with , permission is required. If the file access is , permission is required. If the file is opened with , both and permissions are required. // Token: 0x04000D7A RID: 3450 [Token(Token = "0x4000D7A")] OpenOrCreate, /// Specifies that the operating system should open an existing file. When the file is opened, it should be truncated so that its size is zero bytes. This requires permission. Attempts to read from a file opened with cause an exception. // Token: 0x04000D7B RID: 3451 [Token(Token = "0x4000D7B")] Truncate, /// Opens the file if it exists and seeks to the end of the file, or creates a new file. This requires permission. can be used only in conjunction with . Trying to seek to a position before the end of the file throws an exception, and any attempt to read fails and throws a exception. // Token: 0x04000D7C RID: 3452 [Token(Token = "0x4000D7C")] Append } }