System.IO.FileSystem.Primitives Defines constants for read, write, or read/write access to a file. 2 Read access to the file. Data can be read from the file. Combine with Write for read/write access. Read and write access to the file. Data can be written to and read from the file. Write access to the file. Data can be written to the file. Combine with Read for read/write access. Provides attributes for files and directories. 2 The file is a candidate for backup or removal. The file is compressed. Reserved for future use. The file is a directory. The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and directories. The file is hidden, and thus is not included in an ordinary directory listing. The file or directory includes data integrity support. When this value is applied to a file, all data streams in the file have integrity support. When this value is applied to a directory, all new files and subdirectories within that directory, by default, include integrity support. The file is a standard file that has no special attributes. This attribute is valid only if it is used alone. The file or directory is excluded from the data integrity scan. When this value is applied to a directory, by default, all new files and subdirectories within that directory are excluded from data integrity. The file will not be indexed by the operating system's content indexing service. The file is offline. The data of the file is not immediately available. The file is read-only. The file contains a reparse point, which is a block of user-defined data associated with a file or a directory. The file is a sparse file. Sparse files are typically large files whose data consists of mostly zeros. The file is a system file. That is, the file is part of the operating system or is used exclusively by the operating system. The file is temporary. A temporary file contains data that is needed while an application is executing but is not needed after the application is finished. File systems try to keep all the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed. Specifies how the operating system should open a file. 2 Opens the file if it exists and seeks to the end of the file, or creates a new file. This requires permission. FileMode.Append can be used only in conjunction with FileAccess.Write. 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. Specifies that the operating system should create a new file. If the file already exists, it will be overwritten. This requires permission. FileMode.Create 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. Specifies that the operating system should create a new file. This requires permission. If the file already exists, an exception is thrown. 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. 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 FileAccess.Read, permission is required. If the file access is FileAccess.Write, permission is required. If the file is opened with FileAccess.ReadWrite, both and permissions are required. 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 FileMode.Truncate cause an exception. Contains constants for controlling the kind of access other objects can have to the same file. 2 Allows subsequent deleting of a file. Makes the file handle inheritable by child processes. This is not directly supported by Win32. Declines sharing of the current file. Any request to open the file (by this process or another process) will fail until the file is closed. Allows subsequent opening of the file for reading. If this flag is not specified, any request to open the file for reading (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file. Allows subsequent opening of the file for reading or writing. If this flag is not specified, any request to open the file for reading or writing (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file. Allows subsequent opening of the file for writing. If this flag is not specified, any request to open the file for writing (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file.