The Labs \ Source Viewer \ SSCLI \ System.IO \ FileOptions

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*============================================================
  16. **
  17. ** Enum:  FileOptions
  18. **
  19. **
  20. ** Purpose: Additional options to how to create a FileStream.
  21. **    Exposes the more obscure CreateFile functionality.
  22. **
  23. **
  24. ===========================================================*/
  25. using System;
  26. using System.Runtime.InteropServices;
  27. namespace System.IO
  28. {
  29.     // Maps to FILE_FLAG_DELETE_ON_CLOSE and similar values from winbase.h.
  30.     // We didn't expose a number of these values because we didn't believe
  31.     // a number of them made sense in managed code, at least not yet.
  32.     [Serializable(), Flags()]
  33.     [ComVisible(true)]
  34.     public enum FileOptions
  35.     {
  36.         // NOTE: any change to FileOptions enum needs to be
  37.         // matched in the FileStream ctor for error validation
  38.         None = 0,
  39.         WriteThrough = unchecked((int)2147483648u),
  40.         Asynchronous = unchecked((int)1073741824),
  41.         // FILE_FLAG_OVERLAPPED
  42.         // NoBuffering = 0x20000000,
  43.         RandomAccess = 268435456,
  44.         DeleteOnClose = 67108864,
  45.         SequentialScan = 134217728,
  46.         // AllowPosix = 0x01000000,
  47.         // BackupOrRestore,
  48.         // DisallowReparsePoint = 0x00200000,
  49.         // NoRemoteRecall = 0x00100000,
  50.         Encrypted = 16384
  51.         // FILE_ATTRIBUTE_ENCRYPTED
  52.     }
  53. }

Developer Fusion