dotnet / dotnet/dotnet-api-docs
Should IFileInfo's PhysicalPath always be null?
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
Except for the `PhysicalFileInfo` implementation from the `PhysicalFileProvider`, it seems like `IFileInfo`'s `PhysicalPath` should always be null, especially when the implementation type doesn't use a physical file system.
This seems to be the case for known implementations like your own `ManifestEmbeddedFileProvider`'s `ManifestFileInfo`; and the expectation for a custom implementation like a possible `ZipArchiveFileProvider`'s `ZipEntryFileInfo` based on your `ZipArchive` and `ZipEntry`.
If this is the case, it would be nice to document this understanding... I suspect it's too late to suggest exposing `PhysicalPath` _only_ on the `PhysicalFileInfo`.
https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.fileproviders.ifileinfo.physicalpath?view=dotnet-plat-ext-6.0#microsoft-extensions-fileproviders-ifileinfo-physicalpath
Contributor guide
Assessment
This issue has not been assessed yet.