Skip to content

IDirectoryContents doesn't know it's own name or physical path #36496

Open

Description

GetDirectoryContents returns an IDirectoryContents that has an Exists property and an enumeration of files. What it's missing compared to IFileInfo is the Name and PhysicalPath properties. I can't pass the IDirectoryContents around without wrapping it in my own structure that remembers the name I passed in to retrieve it, and there's no way to get the PhysicalPath except to inspect one of the items in the directory.

Fixing GetFileInfo to support directories would help too (https://github.com/aspnet/Home/issues/2537).

Found while app building for aspnet/AuthSamples#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-Extensions-FileSystembreaking-changeIssue or PR that represents a breaking API or functional change over a prerelease.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions