- Directory.GetLogicalDrives threw PNSE. Follows existing code paths.
- Add common DriveInfoInternal.Browser that is common code path for other implementations
- Environment.GetLogicalDrives
- DriveInfo.Drives
Fix for FileSystemTest https://github.com/dotnet/runtime/blob/master/src/libraries/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Unlink.cs"
Link="Common\Interop\Unix\Interop.Unlink.cs" />
<Compile Include="$(CoreLibSharedDir)System\IO\DriveInfoInternal.Unix.cs"
- Link="Common\System\IO\DriveInfoInternal.Unix.cs" />
+ Link="Common\System\IO\DriveInfoInternal.Unix.cs" Condition="'$(TargetsBrowser)' != 'true'" />
+ <Compile Include="$(CoreLibSharedDir)System\IO\DriveInfoInternal.Browser.cs"
+ Link="Common\System\IO\DriveInfoInternal.Browser.cs" Condition="'$(TargetsBrowser)' == 'true'" />
<Compile Include="$(CoreLibSharedDir)System\IO\PathInternal.Unix.cs"
Link="System\IO\PathInternal.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\GlobalizationMode.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\HijriCalendar.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Guid.Unix.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\IO\DriveInfoInternal.Unix.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\DriveInfoInternal.Unix.cs" Condition="'$(TargetsBrowser)' != 'true'"/>
+ <Compile Include="$(MSBuildThisFileDirectory)System\IO\DriveInfoInternal.Browser.cs" Condition="'$(TargetsBrowser)' == 'true'"/>
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Lock.OSX.cs" Condition="'$(IsOSXLike)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Lock.Unix.cs" Condition="'$(IsOSXLike)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Unix.cs" />
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.IO;
+
namespace System
{
public static partial class Environment
{
// Emscripten VFS mounts at / and is the only drive
- public static string[] GetLogicalDrives() => new string[] { "/" };
+ public static string[] GetLogicalDrives() => DriveInfoInternal.GetLogicalDrives();
// In the mono runtime, this maps to gethostname, which returns 'emscripten'.
// Returning the value here allows us to exclude more of the runtime.
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.IO
+{
+ /// <summary>Contains internal volume helpers that are shared between many projects.</summary>
+ internal static partial class DriveInfoInternal
+ {
+ internal static string[] GetLogicalDrives() => new string[] { "/" };
+ }
+}