From dd69c726b54b07940cd3e45fd65bdd1c6378ded2 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 26 Dec 2016 00:08:01 -0800 Subject: [PATCH] Delete unused file Commit migrated from https://github.com/dotnet/coreclr/commit/cd7ab891d2d0c961a32f0779125ce9190b6ce9e3 --- .../System/IO/PathInternal.CaseSensitivity.cs | 75 ---------------------- .../src/mscorlib/mscorlib.shared.sources.props | 1 - 2 files changed, 76 deletions(-) delete mode 100644 src/coreclr/src/mscorlib/corefx/System/IO/PathInternal.CaseSensitivity.cs diff --git a/src/coreclr/src/mscorlib/corefx/System/IO/PathInternal.CaseSensitivity.cs b/src/coreclr/src/mscorlib/corefx/System/IO/PathInternal.CaseSensitivity.cs deleted file mode 100644 index bea2df9..0000000 --- a/src/coreclr/src/mscorlib/corefx/System/IO/PathInternal.CaseSensitivity.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; - -namespace System.IO -{ - /// Contains internal path helpers that are shared between many projects. - internal static partial class PathInternal - { - private enum Tristate : byte - { - NotInitialized, - True, - False, - } - - private static Tristate s_isCaseSensitive = Tristate.NotInitialized; - - /// Returns a comparison that can be used to compare file and directory names for equality. - internal static StringComparison StringComparison - { - get - { - return IsCaseSensitive ? - StringComparison.Ordinal : - StringComparison.OrdinalIgnoreCase; - } - } - - /// Gets whether the system is case-sensitive. - internal static bool IsCaseSensitive - { - get - { - // This must be lazily initialized as there are dependencies on PathInternal's static constructor - // being fully initialized. (GetIsCaseSensitive() calls GetFullPath() which needs to use PathInternal) - if (s_isCaseSensitive == Tristate.NotInitialized) - s_isCaseSensitive = GetIsCaseSensitive() ? Tristate.True : Tristate.False; - - return s_isCaseSensitive == Tristate.True; - } - } - - /// - /// Determines whether the file system is case sensitive. - /// - /// - /// Ideally we'd use something like pathconf with _PC_CASE_SENSITIVE, but that is non-portable, - /// not supported on Windows or Linux, etc. For now, this function creates a tmp file with capital letters - /// and then tests for its existence with lower-case letters. This could return invalid results in corner - /// cases where, for example, different file systems are mounted with differing sensitivities. - /// - private static bool GetIsCaseSensitive() - { - try - { - string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N")); - using (new FileStream(pathWithUpperCase, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None, 0x1000, FileOptions.DeleteOnClose)) - { - string lowerCased = pathWithUpperCase.ToLowerInvariant(); - return !File.Exists(lowerCased); - } - } - catch (Exception exc) - { - // In case something goes terribly wrong, we don't want to fail just because - // of a casing test, so we assume case-insensitive-but-preserving. - Debug.Fail("Casing test failed: " + exc); - return false; - } - } - } -} diff --git a/src/coreclr/src/mscorlib/mscorlib.shared.sources.props b/src/coreclr/src/mscorlib/mscorlib.shared.sources.props index ffac0f3..ffb6364 100644 --- a/src/coreclr/src/mscorlib/mscorlib.shared.sources.props +++ b/src/coreclr/src/mscorlib/mscorlib.shared.sources.props @@ -783,7 +783,6 @@ - -- 2.7.4