using System; namespace Vanara.PInvoke { public static partial class Kernel32 { /// Enumerates the that may apply to files. /// These flags may be passed to CreateFile. [Flags] public enum FileAccess : uint { /// Read access. GENERIC_READ = ACCESS_MASK.GENERIC_READ, /// Write access. GENERIC_WRITE = ACCESS_MASK.GENERIC_WRITE, /// Execute access. GENERIC_EXECUTE = ACCESS_MASK.GENERIC_EXECUTE, /// All possible access rights. GENERIC_ALL = ACCESS_MASK.GENERIC_ALL, /// /// For a file object, the right to read the corresponding file data. For a directory object, the right to read the corresponding /// directory data. /// FILE_READ_DATA = 0x0001, // file & pipe /// For a directory, the right to list the contents of the directory. FILE_LIST_DIRECTORY = 0x0001, // directory /// /// For a file object, the right to write data to the file. For a directory object, the right to create a file in the directory ( ). /// FILE_WRITE_DATA = 0x0002, // file & pipe /// For a directory, the right to create a file in the directory. FILE_ADD_FILE = 0x0002, // directory /// /// For a file object, the right to append data to the file. (For local files, write operations will not overwrite existing data /// if this flag is specified without .) For a directory object, the right to create a subdirectory /// ( ). /// FILE_APPEND_DATA = 0x0004, // file /// For a directory, the right to create a subdirectory. FILE_ADD_SUBDIRECTORY = 0x0004, // directory /// For a named pipe, the right to create a pipe. FILE_CREATE_PIPE_INSTANCE = 0x0004, // named pipe /// The right to read extended file attributes. FILE_READ_EA = 0x0008, // file & directory /// The right to write extended file attributes. FILE_WRITE_EA = 0x0010, // file & directory /// /// For a native code file, the right to execute the file. This access right given to scripts may cause the script to be /// executable, depending on the script interpreter. /// FILE_EXECUTE = 0x0020, // file /// /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, /// which ignores the FILE_TRAVERSE access right. /// FILE_TRAVERSE = 0x0020, // directory /// For a directory, the right to delete a directory and all the files it contains, including read-only files. FILE_DELETE_CHILD = 0x0040, // directory /// The right to read file attributes. FILE_READ_ATTRIBUTES = 0x0080, // all /// The right to write file attributes. FILE_WRITE_ATTRIBUTES = 0x0100, // all /// SPECIFIC_RIGHTS_ALL = 0x00FFFF, /// FILE_ALL_ACCESS = ACCESS_MASK.STANDARD_RIGHTS_REQUIRED | ACCESS_MASK.SYNCHRONIZE | 0x1FF, /// FILE_GENERIC_READ = ACCESS_MASK.STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | ACCESS_MASK.SYNCHRONIZE, /// FILE_GENERIC_WRITE = ACCESS_MASK.STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | ACCESS_MASK.SYNCHRONIZE, /// FILE_GENERIC_EXECUTE = ACCESS_MASK.STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | ACCESS_MASK.SYNCHRONIZE, } } }