No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

144 líneas
9.5 KiB

  1. /* Copyright (C) 2008-2016 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. * THE SOFTWARE.
  20. */
  21. using System;
  22. using System.Diagnostics.CodeAnalysis;
  23. using System.IO;
  24. namespace Alphaleonis.Win32.Filesystem
  25. {
  26. /// <summary>Specifies how the operating system should open a file.</summary>
  27. [SuppressMessage("Microsoft.Usage", "CA2217:DoNotMarkEnumsWithFlags")]
  28. [Flags]
  29. public enum ExtendedFileAttributes
  30. {
  31. /// <summary>If you pass <see cref="ExtendedFileAttributes.None"/>, the set of attributes is unspecified. <see cref="ExtendedFileAttributes.Normal"/> explicitly sets no attributes.</summary>
  32. None = 0,
  33. #region FILE_ATTRIBUTE - Attributes applying to any file
  34. /// <summary>The file is read only. Applications can read the file, but cannot write to or delete it.</summary>
  35. /// <remarks>Equals <see cref="FileAttributes.ReadOnly"/>1</remarks>
  36. ReadOnly = FileAttributes.ReadOnly,
  37. /// <summary>The file is hidden. Do not include it in an ordinary directory listing.</summary>
  38. /// <remarks>Equals <see cref="FileAttributes.Hidden"/>2</remarks>
  39. Hidden = FileAttributes.Hidden,
  40. /// <summary>The file is part of or used exclusively by an operating system.</summary>
  41. /// <remarks>Equals <see cref="FileAttributes.System"/>4</remarks>
  42. System = FileAttributes.System,
  43. /// <summary>The handle that identifies a directory.</summary>
  44. /// <remarks>Equals <see cref="FileAttributes.Directory"/>16</remarks>
  45. Directory = FileAttributes.Directory,
  46. /// <summary>The file should be archived. Applications use this attribute to mark files for backup or removal.</summary>
  47. /// <remarks>Equals <see cref="FileAttributes.Archive"/>32</remarks>
  48. Archive = FileAttributes.Archive,
  49. /// <summary>The file should be archived. Applications use this attribute to mark files for backup or removal.</summary>
  50. /// <remarks>Equals <see cref="FileAttributes.Device"/>64</remarks>
  51. Device = FileAttributes.Device,
  52. /// <summary>The file does not have other attributes set. This attribute is valid only if used alone.</summary>
  53. /// <remarks>Equals <see cref="FileAttributes.Normal"/>128</remarks>
  54. Normal = FileAttributes.Normal,
  55. /// <summary>The file is being used for temporary storage.</summary>
  56. /// <remarks>Equals <see cref="FileAttributes.Temporary"/>256</remarks>
  57. Temporary = FileAttributes.Temporary,
  58. /// <summary>A file that is a sparse file.</summary>
  59. /// <remarks>Equals <see cref="FileAttributes.SparseFile"/>512</remarks>
  60. SparseFile = FileAttributes.SparseFile,
  61. /// <summary>A file or directory that has an associated reparse point, or a file that is a symbolic link.</summary>
  62. /// <remarks>Equals <see cref="FileAttributes.ReparsePoint"/>1024</remarks>
  63. ReparsePoint = FileAttributes.ReparsePoint,
  64. /// <summary>A file or directory that is compressed. For a file, all of the data in the file is compressed. For a directory, compression is the default for newly created files and subdirectories.</summary>
  65. /// <remarks>Equals <see cref="FileAttributes.Compressed"/>2048</remarks>
  66. Compressed = FileAttributes.Compressed,
  67. /// <summary>The data of a file is not immediately available. This attribute indicates that file data is physically moved to offline storage. This attribute is used by Remote Storage, the hierarchical storage management software. Applications should not arbitrarily change this attribute.</summary>
  68. /// <remarks>Equals <see cref="FileAttributes.Offline"/>4096</remarks>
  69. Offline = FileAttributes.Offline,
  70. /// <summary>The file or directory is not to be indexed by the content indexing service.</summary>
  71. /// <remarks>Equals <see cref="FileAttributes.NotContentIndexed"/>8192</remarks>
  72. NotContentIndexed = FileAttributes.NotContentIndexed,
  73. /// <summary>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 subdirectories.</summary>
  74. /// <remarks>Equals <see cref="FileOptions.Encrypted"/>16384</remarks>
  75. Encrypted = FileOptions.Encrypted,
  76. #endregion // FILE_ATTRIBUTE - Attributes applying to any file
  77. /// <summary>The directory or user data stream is configured with integrity (only supported on ReFS volumes). It is not included in an ordinary directory listing. The integrity setting persists with the file if it's renamed. If a file is copied the destination file will have integrity set if either the source file or destination directory have integrity set.</summary>
  78. /// <remarks>This flag is not supported until Windows Server 2012.</remarks>
  79. IntegrityStream = 32768,
  80. /// <summary>The user data stream not to be read by the background data integrity scanner (AKA scrubber). When set on a directory it only provides inheritance. This flag is only supported on Storage Spaces and ReFS volumes. It is not included in an ordinary directory listing.</summary>
  81. /// <remarks>This flag is not supported until Windows Server 2012.</remarks>
  82. NoScrubData = 131072,
  83. /// <summary>...</summary>
  84. FirstPipeInstance = 524288,
  85. /// <summary>The file data is requested, but it should continue to be located in remote storage. It should not be transported back to local storage. This flag is for use by remote storage systems.</summary>
  86. OpenNoRecall = 1048576,
  87. /// <summary>Normal reparse point processing will not occur; an attempt to open the reparse point will be made. When a file is opened, a file handle is returned, whether or not the filter that controls the reparse point is operational. See MSDN documentation for more information.</summary>
  88. OpenReparsePoint = 2097152,
  89. /// <summary>Access will occur according to POSIX rules. This includes allowing multiple files with names, differing only in case, for file systems that support that naming. Use care when using this option, because files created with this flag may not be accessible by applications that are written for MS-DOS or 16-bit Windows.</summary>
  90. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Posix")]
  91. PosixSemantics = 16777216,
  92. /// <summary>The file is being opened or created for a backup or restore operation. The system ensures that the calling process overrides file security checks when the process has SE_BACKUP_NAME and SE_RESTORE_NAME privileges. You must set this flag to obtain a handle to a directory. A directory handle can be passed to some functions instead of a file handle.</summary>
  93. BackupSemantics = 33554432,
  94. /// <summary>The file is to be deleted immediately after all of its handles are closed, which includes the specified handle and any other open or duplicated handles. If there are existing open handles to a file, the call fails unless they were all opened with the <see cref="FileShare.Delete"/> share mode. Subsequent open requests for the file fail, unless the <see cref="FileShare.Delete"/> share mode is specified.</summary>
  95. /// <remarks>Equals <see cref="FileOptions.DeleteOnClose"/>67108864</remarks>
  96. DeleteOnClose = FileOptions.DeleteOnClose,
  97. /// <summary>Access is intended to be sequential from beginning to end. The system can use this as a hint to optimize file caching.</summary>
  98. /// <remarks>Equals <see cref="FileOptions.SequentialScan"/>134217728</remarks>
  99. SequentialScan = FileOptions.SequentialScan,
  100. /// <summary>Access is intended to be random. The system can use this as a hint to optimize file caching.</summary>
  101. /// <remarks>Equals <see cref="FileOptions.RandomAccess"/>268435456</remarks>
  102. RandomAccess = FileOptions.RandomAccess,
  103. /// <summary>There are strict requirements for successfully working with files opened with the <see cref="NoBuffering"/> flag, for details see the section on "File Buffering" in the online MSDN documentation.</summary>
  104. NoBuffering = 536870912,
  105. /// <summary>The file or device is being opened or created for asynchronous I/O.</summary>
  106. /// <remarks>Equals <see cref="FileOptions.Asynchronous"/>1073741824</remarks>
  107. Overlapped = FileOptions.Asynchronous,
  108. /// <summary>Write operations will not go through any intermediate cache, they will go directly to disk.</summary>
  109. /// <remarks>Equals .NET <see cref="FileOptions.WriteThrough"/>-2147483648</remarks>
  110. WriteThrough = FileOptions.WriteThrough
  111. }
  112. }