-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
area-Extensions-FileSystemfeature-requestneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
Milestone
Description
From @stilettk on Friday, November 3, 2017 2:56:28 AM
Currently GetFileInfo supports only files: when called on a path that points to a directory it returns PhysicalFileInfo which has IsDirectory == false.
So, when given a path, how to decide what to do: to call GetFileInfo (if it's a file) or call GetDirectoryContents (if it's a folder)? Currently the only way I found isn't very intuitive:
bool isDirectory = fileProvider.GetDirectoryContents(myPath).Exists
My suggestion:
new PhysicalFileProvider(myPath).GetFileInfo("data")
Expected:
PhysicalDirectoryInfo
Actual:
PhysicalFileInfo
Copied from original issue: aspnet/FileSystem#298
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Extensions-FileSystemfeature-requestneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.