Skip to content

Commit

Permalink
Fold System.IO.FileSystem into CoreLib (#53231)
Browse files Browse the repository at this point in the history
* move Queue<T> to System.Private.CoreLib

* fold System.IO.FileSystem into System.Private.CoreLib
  • Loading branch information
adamsitnik authored May 27, 2021
1 parent 6e5f722 commit 44f050a
Show file tree
Hide file tree
Showing 57 changed files with 553 additions and 1,068 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ internal static extern unsafe int NtQueryInformationFile(
uint Length,
uint FileInformationClass);

[StructLayout(LayoutKind.Sequential)]
internal struct IO_STATUS_BLOCK
{
private uint Status;
private IntPtr Information;
}

internal const uint FileModeInformation = 16;

internal const int STATUS_INVALID_HANDLE = unchecked((int)0xC0000008);
Expand Down
49 changes: 24 additions & 25 deletions src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,51 @@
<IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Directory.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Directory.cs"
Link="Microsoft\IO\Directory.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\DirectoryInfo.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\DirectoryInfo.cs"
Link="Microsoft\IO\DirectoryInfo.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemEntry.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemEntry.cs"
Link="Microsoft\IO\Enumeration\FileSystemEntry.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemEntry.Windows.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemEntry.Windows.cs"
Link="Microsoft\IO\Enumeration\FileSystemEntry.Windows.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemEnumerable.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemEnumerable.cs"
Link="Microsoft\IO\Enumeration\FileSystemEnumerable.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemEnumerableFactory.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemEnumerableFactory.cs"
Link="Microsoft\IO\Enumeration\FileSystemEnumerableFactory.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemEnumerator.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemEnumerator.cs"
Link="Microsoft\IO\Enumeration\FileSystemEnumerator.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemEnumerator.Win32.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemEnumerator.Win32.cs"
Link="Microsoft\IO\Enumeration\FileSystemEnumerator.Win32.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemEnumerator.Windows.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemEnumerator.Windows.cs"
Link="Microsoft\IO\Enumeration\FileSystemEnumerator.Windows.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Enumeration\FileSystemName.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Enumeration\FileSystemName.cs"
Link="Microsoft\IO\Enumeration\FileSystemName.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\EnumerationOptions.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\EnumerationOptions.cs"
Link="Microsoft\IO\EnumerationOptions.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Error.cs"
Link="Microsoft\IO\Error.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\File.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\File.cs"
Link="Microsoft\IO\File.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\FileInfo.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\FileInfo.cs"
Link="Microsoft\IO\FileInfo.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\FileSystem.Win32.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\FileSystem.Win32.cs"
Link="Microsoft\IO\FileSystem.Win32.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\FileSystem.Windows.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\FileSystem.Windows.cs"
Link="Microsoft\IO\FileSystem.Windows.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\FileSystemInfo.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\FileSystemInfo.cs"
Link="Microsoft\IO\FileSystemInfo.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\FileSystemInfo.Windows.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\FileSystemInfo.Windows.cs"
Link="Microsoft\IO\FileSystemInfo.Windows.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Iterator.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\Iterator.cs"
Link="Microsoft\IO\Iterator.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\MatchCasing.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\MatchCasing.cs"
Link="Microsoft\IO\MatchCasing.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\MatchType.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\MatchType.cs"
Link="Microsoft\IO\MatchType.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\ReadLinesIterator.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\ReadLinesIterator.cs"
Link="Microsoft\IO\ReadLinesIterator.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\SearchOption.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\SearchOption.cs"
Link="Microsoft\IO\SearchOption.cs" />
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\SearchTarget.cs"
<Compile Include="$(CoreLibSharedDir)System\IO\SearchTarget.cs"
Link="Microsoft\IO\SearchTarget.cs" />
<Compile Include="$(CommonPath)Interop\Windows\BCrypt\Interop.BCryptGenRandom.cs"
Link="Interop\Windows\BCrypt\Interop.BCryptGenRandom.cs" />
Expand Down Expand Up @@ -195,6 +193,7 @@
<Compile Include="$(CoreLibSharedDir)System\Runtime\InteropServices\SuppressGCTransitionAttribute.cs"
Link="System\Runtime\InteropServices\SuppressGCTransitionAttribute.cs" />
<Compile Include="Microsoft\IO\StringExtensions.cs" />
<Compile Include="Microsoft\IO\ThrowHelper.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
Expand Down
16 changes: 16 additions & 0 deletions src/libraries/Microsoft.IO.Redist/src/Microsoft/IO/ThrowHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.IO;

namespace Microsoft.IO
{
internal static class ThrowHelper
{
internal static void ThrowEndOfFileException()
{
throw new EndOfStreamException(SR.IO_EOF_ReadBeyondEOF);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.ComponentModel\ref\System.ComponentModel.csproj" />
<ProjectReference Include="..\..\System.IO.FileSystem\ref\System.IO.FileSystem.csproj" />
<ProjectReference Include="..\..\System.IO.FileSystem.DriveInfo\ref\System.IO.FileSystem.DriveInfo.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<Compile Include="System\Collections\Generic\LinkedList.cs" />
<Compile Include="System\Collections\Generic\PriorityQueue.cs" />
<Compile Include="System\Collections\Generic\PriorityQueueDebugView.cs" />
<Compile Include="System\Collections\Generic\Queue.cs" />
<Compile Include="System\Collections\Generic\QueueDebugView.cs" />
<Compile Include="System\Collections\Generic\SortedDictionary.cs" />
<Compile Include="System\Collections\Generic\SortedList.cs" />
<Compile Include="System\Collections\Generic\SortedSet.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.IO.FileSystem.Primitives\ref\System.IO.FileSystem.Primitives.csproj" />
<ProjectReference Include="..\..\System.IO.FileSystem\ref\System.IO.FileSystem.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
</ItemGroup>
<ItemGroup Condition=" '$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">
<Compile Include="System\IO\FileSystemWatcher.OSX.cs" />
<Compile Include="$(LibrariesProjectRoot)System.IO.FileSystem\src\System\IO\FileSystem.Exists.Unix.cs"
Link="System.IO.FileSystem\src\System\IO\FileSystem.Exists.Unix.cs" />
<Compile Include="$(CoreLibSharedDir)System\IO\FileSystem.Exists.Unix.cs"
Link="System\IO\FileSystem.Exists.Unix.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.EventStream.cs"
Link="Common\Interop\OSX\Interop.EventStream.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.SafeFileHandle))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileStream))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Directory))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.DirectoryInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.EnumerationOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.File))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileSystemInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.MatchCasing))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.MatchType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.SearchOption))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Enumeration.FileSystemEntry))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Enumeration.FileSystemEnumerable<>))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Enumeration.FileSystemEnumerator<>))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Enumeration.FileSystemName))]

Loading

0 comments on commit 44f050a

Please sign in to comment.