445 references to FileMode
Microsoft.Activities.Build (2)
mscorlib (95)
system\io\file.cs (13)
178using(SafeFileHandle handle = Win32Native.UnsafeCreateFile(fullSourceFileName, FileStream.GENERIC_READ, FileShare.Read, null, FileMode.Open, 0, IntPtr.Zero)) {
221return new FileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, bufferSize);
227return new FileStream(path, FileMode.Create, FileAccess.ReadWrite,
233return new FileStream(path, FileMode.Create, FileSystemRights.Read | FileSystemRights.Write,
467public static FileStream Open(String path, FileMode mode) {
468return Open(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None);
473public static FileStream Open(String path, FileMode mode, FileAccess access) {
479public static FileStream Open(String path, FileMode mode, FileAccess access, FileShare share) {
769return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
776return new FileStream(path, FileMode.OpenOrCreate,
917using(FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read,
978using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read,
1457FileStream fs = new FileStream(path, FileMode.Open, access, FileShare.ReadWrite, 1);
system\io\filestream.cs (27)
511public FileStream(String path, FileMode mode)
512: this(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.Read, DefaultBufferSize, FileOptions.None, Path.GetFileName(path), false) {
518public FileStream(String path, FileMode mode, FileAccess access)
525public FileStream(String path, FileMode mode, FileAccess access, FileShare share)
532public FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize)
541public FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options)
553public FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync)
564public FileStream(String path, FileMode mode, FileSystemRights rights, FileShare share, int bufferSize, FileOptions options, FileSecurity fileSecurity)
582public FileStream(String path, FileMode mode, FileSystemRights rights, FileShare share, int bufferSize, FileOptions options)
592internal FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, String msgPath, bool bFromProxy)
601internal FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, String msgPath, bool bFromProxy, bool useLongPath)
610internal FileStream(String path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, String msgPath, bool bFromProxy, bool useLongPath, bool checkHost)
620private void Init(String path, FileMode mode, FileAccess access, int rights, bool useRights, FileShare share, int bufferSize, FileOptions options, Win32Native.SECURITY_ATTRIBUTES secAttrs, String msgPath, bool bFromProxy, bool useLongPath, bool checkHost)
644if (mode < FileMode.CreateNew || mode > FileMode.Append)
673if (mode==FileMode.Truncate || mode==FileMode.CreateNew || mode==FileMode.Create || mode==FileMode.Append) {
687if (useRights && (mode == FileMode.Truncate)) {
739if (mode == FileMode.Append)
762Contract.Assert(mode != FileMode.Append);
782&& mode==FileMode.OpenOrCreate)
788if (mode==FileMode.Append)
818bool seekToEnd = (mode==FileMode.Append);
820if (mode == FileMode.Append)
821mode = FileMode.OpenOrCreate;
system\io\isolatedstorage\isolatedstoragefile.cs (6)
1259public IsolatedStorageFileStream OpenFile(string path, FileMode mode) {
1265public IsolatedStorageFileStream OpenFile(string path, FileMode mode, FileAccess access) {
1270public IsolatedStorageFileStream OpenFile(string path, FileMode mode, FileAccess access, FileShare share) {
1276return new IsolatedStorageFileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, this);
2385using(FileStream fs = new FileStream(path + s_IDFile, FileMode.OpenOrCreate)) {
2763using(FileStream fs = new FileStream(sb.ToString(), FileMode.Open)) {
system\io\isolatedstorage\isolatedstoragefilestream.cs (24)
55public IsolatedStorageFileStream(String path, FileMode mode)
56: this(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None, null) {
61public IsolatedStorageFileStream(String path, FileMode mode,
63: this(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None, isf)
70public IsolatedStorageFileStream(String path, FileMode mode,
79public IsolatedStorageFileStream(String path, FileMode mode,
88public IsolatedStorageFileStream(String path, FileMode mode,
96public IsolatedStorageFileStream(String path, FileMode mode,
104public IsolatedStorageFileStream(String path, FileMode mode,
115public IsolatedStorageFileStream(String path, FileMode mode,
148case FileMode.CreateNew: // Assume new file
149case FileMode.Create: // Check for New file & Unreserve
150case FileMode.OpenOrCreate: // Check for new file
151case FileMode.Truncate: // Unreserve old file size
152case FileMode.Append: // Check for new file
153case FileMode.Open: // Open existing, else exception
185case FileMode.CreateNew: // Assume new file
193case FileMode.Create: // Check for New file & Unreserve
194case FileMode.OpenOrCreate: // Check for new file
195case FileMode.Truncate: // Unreserve old file size
196case FileMode.Append: // Check for new file
215case FileMode.Open: // Open existing, else exception
271((mode == FileMode.Truncate) || (mode == FileMode.Create)))
PresentationBuildTasks (6)
PresentationCore (8)
PresentationFramework (17)
System (35)
compmod\microsoft\csharp\csharpcodeprovider.cs (6)
674Stream temp = new FileStream(responseFileName, FileMode.Create, FileAccess.Write, FileShare.Read);
3399new FileStream(options.OutputAssembly, FileMode.Create, FileAccess.ReadWrite).Close();
3464using (FileStream fs = new FileStream(options.OutputAssembly, FileMode.Open, FileAccess.Read, FileShare.Read))
3511using(FileStream stream = File.Open(file, FileMode.Open, FileAccess.Read, share))
3737Stream temp = new FileStream(filenames[i], FileMode.Create, FileAccess.Write, FileShare.Read);
3811FileStream fileStream = new FileStream(name, FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
compmod\system\codedom\compiler\CodeCompiler.cs (6)
265Stream temp = new FileStream(filenames[i], FileMode.Create, FileAccess.Write, FileShare.Read);
348new FileStream(options.OutputAssembly, FileMode.Create, FileAccess.ReadWrite).Close();
375FileStream outputStream = new FileStream(outputFile, FileMode.Open,
402FileStream fs = new FileStream(options.OutputAssembly, FileMode.Open, FileAccess.Read, FileShare.Read);
458Stream temp = new FileStream(responseFileName, FileMode.Create, FileAccess.Write, FileShare.Read);
503FileStream fileStream = new FileStream(name, FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
net\System\Net\Cache\IERequestCache.cs (2)
628: base(entry.Filename, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete, 4096, async)
815base(entry.Filename, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 4096, async) {
net\System\Net\filewebrequest.cs (3)
434request.m_stream = new FileWebStream(request, request.m_uri.LocalPath, FileMode.Create, FileAccess.Write, FileShare.Read);
566public FileWebStream(FileWebRequest request, string path, FileMode mode, FileAccess access, FileShare sharing)
576public FileWebStream(FileWebRequest request, string path, FileMode mode, FileAccess access, FileShare sharing, int length, bool async)
System.Activities (1)
System.Activities.Presentation (3)
System.AddIn (1)
System.Configuration (5)
System.Core (15)
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (6)
105return CreateFromFile(path, FileMode.Open, null, DefaultSize, MemoryMappedFileAccess.ReadWrite);
107public static MemoryMappedFile CreateFromFile(String path, FileMode mode) {
111public static MemoryMappedFile CreateFromFile(String path, FileMode mode, String mapName) {
115public static MemoryMappedFile CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity) {
121public static MemoryMappedFile CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity,
140if (mode == FileMode.Append) {
System.Data (6)
System.Data.Entity.Design (1)
System.Data.Services.Design (1)
System.Drawing (2)
System.IO.Log (18)
System.Management (1)
System.Runtime.Remoting (1)
System.Web (30)
HttpResponse.cs (4)
2769f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
2816using (FileStream f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)) {
2847f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
2895f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
System.Web.DataVisualization (7)
System.Web.Extensions (3)
System.Web.Services (1)
System.Windows.Forms (8)
System.Windows.Forms.DataVisualization (6)
System.Workflow.ComponentModel (3)
System.WorkflowServices (2)
System.Xml (5)
WindowsBase (161)
Base\MS\Internal\IO\Zip\ZipArchive.cs (37)
71internal static ZipArchive OpenOnFile(string path, FileMode mode, FileAccess access, FileShare share, bool streaming)
73if (mode == FileMode.OpenOrCreate || mode == FileMode.Open)
126internal static ZipArchive OpenOnStream(Stream stream, FileMode mode, FileAccess access, bool streaming)
140case FileMode.Open:
148case FileMode.CreateNew:
154case FileMode.Create:
451private ZipArchive(Stream archiveStream, FileMode mode, FileAccess access, bool streaming, bool ownStream)
465if ((_openMode == FileMode.CreateNew) ||
466(_openMode == FileMode.Create) ||
467((_openMode == FileMode.OpenOrCreate) && archiveStream.Length == 0))
524static private void ValidateModeAccessShareStreaming(Stream stream, FileMode mode, FileAccess access, FileShare share, bool streaming)
592static private void ValidateModeAccessShareSupportedEnums(FileMode mode, FileShare share)
598if (mode == FileMode.Append || mode == FileMode.Truncate)
609static private void ValidateModeAccessShareValidEnums(FileMode mode, FileAccess access, FileShare share)
614if ((mode != FileMode.Append) && (mode != FileMode.Create) && (mode != FileMode.CreateNew) && (mode != FileMode.Open)
615&& (mode != FileMode.OpenOrCreate) && (mode != FileMode.Truncate))
674{(int)FileMode.Create, (int)FileAccess.Write, (int)FileShare.None, 1},
675{(int)FileMode.Create, (int)FileAccess.Write, (int)FileShare.Read, 1},
676{(int)FileMode.Create, (int)FileAccess.ReadWrite, (int)FileShare.None, 0},
677{(int)FileMode.CreateNew, (int)FileAccess.Write, (int)FileShare.None, 1},
678{(int)FileMode.CreateNew, (int)FileAccess.Write, (int)FileShare.Read, 1},
679{(int)FileMode.CreateNew, (int)FileAccess.ReadWrite, (int)FileShare.None, 0},
680{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.None, 1},
681{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.None, 0},
682{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.Read, 1},
683{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.Read, 0},
684{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.Write, 1},
685{(int)FileMode.Open, (int)FileAccess.Read, (int)FileShare.ReadWrite, 1},
686{(int)FileMode.Open, (int)FileAccess.ReadWrite, (int)FileShare.None, 0},
687{(int)FileMode.OpenOrCreate, (int)FileAccess.ReadWrite, (int)FileShare.None, 0}
692private FileMode _openMode;
Base\System\IO\Packaging\EncryptedPackage.cs (11)
515root = StorageRoot.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
573root = StorageRoot.CreateOnStream(stream, FileMode.Open);
753FileMode.Open,
1004_packageStream = siPackage.GetStream(FileMode.Open, this.FileOpenAccess);
1152FileMode.Create,
1164_package = Package.Open(_packageStream, FileMode.Open, this.FileOpenAccess);
1171_package = Package.Open(_packageStream, FileMode.Create, FileAccess.ReadWrite);
1227private const FileMode _defaultFileModeForCreate = FileMode.Create;
1231private const FileMode _defaultFileModeForOpen = FileMode.Open;
Base\System\IO\Packaging\Package.cs (18)
161public static Package Open(string path, FileMode packageMode)
178public static Package Open(string path, FileMode packageMode, FileAccess packageAccess)
204public static Package Open(string path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare)
241public static Package Open(Stream stream, FileMode packageMode)
261public static Package Open(Stream stream, FileMode packageMode, FileAccess packageAccess)
933internal static void ThrowIfFileModeInvalid(FileMode mode)
936if (mode < FileMode.CreateNew || mode > FileMode.Append)
973FileMode packageMode,
1050internal static Package Open(Stream stream, FileMode packageMode, FileAccess packageAccess, bool streaming)
1200FileMode packageMode,
1207if (packageMode == FileMode.Create || packageMode == FileMode.CreateNew)
1225private static Stream ValidateModeAndAccess(Stream s, FileMode mode, FileAccess access)
1455private static readonly FileMode _defaultFileMode = FileMode.OpenOrCreate;
1459private static readonly FileMode _defaultStreamMode = FileMode.Open;
Base\System\IO\Packaging\ZipPackage.cs (6)
401internal ZipPackage(string path, FileMode mode, FileAccess access, FileShare share, bool streaming)
437internal ZipPackage(Stream s, FileMode mode, FileAccess access, bool streaming)
1044using (Stream s = _contentTypeFileInfo.GetStream(FileMode.Create, _zipArchive.OpenAccess))
1303return _contentTypeFileInfo.GetStream(FileMode.Open, FileAccess.Read);
1315pieces, FileMode.Open, FileAccess.Read);
1497FileMode.Create, FileAccess.Write);
XamlBuildTask (1)