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
{{ message }}
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.
Not sure why we do this inline, but I was profiling the static file middleware and saw enumeration even though it's just checking for directory existence:
The text was updated successfully, but these errors were encountered:
davidfowl
changed the title
Delay enumeration of directory until Directory enumerated
Delay enumeration of directory until IDirectoryContents enumerated
Aug 8, 2016
I just had a somewhat similar problem in a WebDAV middleware implementation: I just want to check a path validity, and if this path represents a file or a directory.
Calling GetFileInfo works for the files but not for the directories. So if it fails, I have to call GetDirectoryContents to check if it is a directory. And of course it enumerates all child entries for nothing in my case.
So just for curiosity, why GetFileInfo does not return a valid IFileInfo for a directory? For performance reasons in case of the path is invalid?
Not sure why we do this inline, but I was profiling the static file middleware and saw enumeration even though it's just checking for directory existence:
https://github.com/aspnet/FileSystem/blob/dev/src/Microsoft.Extensions.FileProviders.Physical/PhysicalFileProvider.cs#L219-L236
https://github.com/aspnet/StaticFiles/blob/dev/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs#L69-L95
The text was updated successfully, but these errors were encountered: