You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A directory exists but when calling GetFileInfo to obtain an "abstract" IFIleInfo it does not.
However when a directory is returned by the enumeration of a IDirectoryContents, a IFileInfo is correctly returned (with both Exists and IsDirectory sets to true).
This means that the code that handles a IFileInfo HAS to be aware of how it has been created/obtained.
[Test]publicvoidstandard_physical_file_provider_is_full_of_surprises(){using(varpStd=newPhysicalFileProvider(LocalTestHelper.WorldFolder)){varfCA=pStd.GetDirectoryContents("TestGitRepository");fCA.Exists.Should().BeTrue("Yes, this is a directory...");varfA=pStd.GetFileInfo("TestGitRepository");fA.IsDirectory.Should().BeFalse("What??? This IS a directory!");fA.Exists.Should().BeFalse("And it DOES exist !");}}
I suspect that this oddity is due to the FileSystemInfo being abstract: the current code uses a new FileInfo for its PhysicalFileInfo returned object, totally missing the IsDirectory possibility.
Any chance for this to be fixed? Or should I go with my own SimplePhysicalFileProvider?