peteraritchie / LongPath

drop-in library to support long paths in .NET
GNU Lesser General Public License v3.0
112 stars 43 forks source link

Difference from File.Exists when space is present in directory #48

Closed alkampfergit closed 4 years ago

alkampfergit commented 7 years ago

I admit that this is a really strange one, but here is the situation

Create a c:\temp\test.txt in your disk

Run this piece of code

string file = @"c:\temp \test.txt";
Console.WriteLine("System.IO.File.Exists(file) = {0}", System.IO.File.Exists(file));
Console.WriteLine("Pri.LongPath.File.Exists(file) = {0}", Pri.LongPath.File.Exists(file));
Console.ReadKey();

If you look at the code I've inserted a space between temp and directory separator. Actually the standard File.IO.File.exists returns true, while Pri.LongPath.File returns false.

Gian Maria.