Open
Description
.NET Core 2.1 System.IO API changes
There are a number of behavior changes to System.IO APIs in .NET Core 2.1 and new APIs. This issue summarizes the high level changes and links to relevant documents.
Still Needed:
- Content Types
- Table of Contents
- Prioritization
General
APIs have been modified to better support cross platform code writing and substantially improve performance. Here is a summary of the API changes:
- Path validation has been simplified
- Span overloads have been added for a number of
System.IO.Path
APIs - There is a new overload for
Path.GetFullPath()
that allows specifying a base path for resolving the path - Directory enumeration results are more consistent cross-plat
- New enumeration options have been added
- A new extensible enumeration API has been added
Initial details are below. I'll be adding more links and details shortly.
Path Validation
To facilitate writing cross platform code, System.IO.Path APIs have had their preemptive error checking simplified. Notably:
Path.GetFullPath()
only checks for embedded nulls, null strings, and empty strings- No IO APIs check for invalid characters
Path.GetDirectoryName()
returns null for empty strings, instead of throwing- Search patterns are no longer validated beyond null check and rooting (they cannot return true from
Path.IsPathRooted()
)
Span overloads
https://github.com/dotnet/corefx/issues/25539
Path.GetFullPath overload
https://github.com/dotnet/corefx/issues/25539