Fix fat Directory.Exists, so it works with case insensitive match as well.

This commit is contained in:
Matthijs ter Woord 2015-07-04 15:53:04 +02:00
parent ebba2f13b0
commit 7e481aaee3
4 changed files with 13 additions and 3 deletions

View file

@ -24,7 +24,7 @@ namespace SentinelKernel
try
{
var xRoot = Path.GetPathRoot(@"0:\test");
bool xTest = Directory.Exists("0:\\TEST");
bool xTest = Directory.Exists("0:\\test");
Console.WriteLine("After test");
if (xTest)
{
@ -41,7 +41,7 @@ namespace SentinelKernel
Console.WriteLine("Exception occurred:");
Console.WriteLine(e.Message);
}
Stop();
}
}

View file

@ -8,7 +8,7 @@ namespace SentinelKernel.System.FileSystem
private static Debugger mDebugger = new Debugger("FAT", "Debug");
public static void Debug(string message)
{
//mDebugger.Send("FAT Debug: " + message);
mDebugger.Send("FAT Debug: " + message);
}
}
}

View file

@ -243,6 +243,10 @@ namespace SentinelKernel.System.FileSystem.VFS
for (int j = 0; j < xListing.Count; j++)
{
var xListingItem = xListing[j];
Console.Write("xListingItem.Name: ");
Console.WriteLine(xListingItem.Name);
Console.Write("xPathPart: ");
Console.WriteLine(xPathPart);
if (String.Equals(xListingItem.Name, xPathPart, StringComparison.OrdinalIgnoreCase))
{
if (xListingItem is Listing.Directory)

View file

@ -144,6 +144,12 @@ namespace Cosmos.Core.Plugs {
public static bool Equals(string aThis, string aThat, StringComparison aComparison) {
#warning TODO: implement
if (aComparison == StringComparison.OrdinalIgnoreCase)
{
var xLowerThis = aThis.ToLower();
var xLowerThat = aThat.ToLower();
return EqualsHelper(xLowerThis, xLowerThat);
}
return EqualsHelper(aThis,
aThat);
}