From: Jeremy Kuhne Date: Fri, 17 Mar 2017 00:21:10 +0000 (-0700) Subject: Attribute the other types used by FileStream. Adds the internal methods the old CoreF... X-Git-Tag: submit/tizen/20210909.063632~11030^2~7679^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=609f9af4148896c214e521416111cde774d4857a;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Attribute the other types used by FileStream. Adds the internal methods the old CoreFX uses. https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?id=396302&_a=edit [tfs-changeset: 1651151] Commit migrated from https://github.com/dotnet/coreclr/commit/6cc92a84d44e14b3ff37fcd4f9bb504cf74e4aa5 --- diff --git a/src/coreclr/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs b/src/coreclr/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs index 4eabe8f..a1abdd0 100644 --- a/src/coreclr/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs +++ b/src/coreclr/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs @@ -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; diff --git a/src/coreclr/src/mscorlib/shared/System/IO/FileStream.WinRT.cs b/src/coreclr/src/mscorlib/shared/System/IO/FileStream.WinRT.cs index 9c3f048..df5e996 100644 --- a/src/coreclr/src/mscorlib/shared/System/IO/FileStream.WinRT.cs +++ b/src/coreclr/src/mscorlib/shared/System/IO/FileStream.WinRT.cs @@ -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); + } + } }