Attribute the other types used by FileStream. Adds the internal methods the old CoreF...
authorJeremy Kuhne <jeremy.kuhne@microsoft.com>
Fri, 17 Mar 2017 00:21:10 +0000 (17:21 -0700)
committerdotnet-bot <dotnet-bot@microsoft.com>
Fri, 17 Mar 2017 16:42:35 +0000 (16:42 +0000)
https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?id=396302&_a=edit

[tfs-changeset: 1651151]

Commit migrated from https://github.com/dotnet/coreclr/commit/6cc92a84d44e14b3ff37fcd4f9bb504cf74e4aa5

src/coreclr/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs
src/coreclr/src/mscorlib/shared/System/IO/FileStream.WinRT.cs

index 4eabe8f..a1abdd0 100644 (file)
@@ -10,6 +10,9 @@ using Microsoft.Win32;
 
 namespace Microsoft.Win32.SafeHandles
 {
+#if PROJECTN
+    [Internal.Runtime.CompilerServices.RelocatedTypeAttribute("System.IO.FileSystem")]
+#endif
     public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid
     {
         private bool? _isAsync;
index 9c3f048..df5e996 100644 (file)
@@ -54,5 +54,22 @@ namespace System.IO
 
             return fileHandle;
         }
+
+        // TODO: These internal methods should be removed once we start consuming updated CoreFX builds
+        internal static FileStream InternalOpen(string path, int bufferSize = 4096, bool useAsync = true)
+        {
+            return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize, useAsync);
+        }
+
+        internal static FileStream InternalCreate(string path, int bufferSize = 4096, bool useAsync = true)
+        {
+            return new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, bufferSize, useAsync);
+        }
+
+        internal static FileStream InternalAppend(string path, int bufferSize = 4096, bool useAsync = true)
+        {
+            return new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.Read, bufferSize, useAsync);
+        }
+
     }
 }