Skip to content

Latest commit

 

History

393 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

TruePath Status Ventis

This is a library containing a set of types to work with file system paths in .NET.

Motivation

Historically, .NET has been lacking a good set of types to work with file system paths. The System.IO.Path class has a variety of methods that operate on path strings, but it doesn't provide any types to represent paths themselves. It's impossible to tell whether a method accepts an absolute path, a relative path, a file name, or something file-related at all, only looking at its signature: all these types are represented by plain strings. Also, comparing different paths is not straightforward.

This library aims to fill this gap by providing a set of types that represent paths in a strongly-typed way. Now, you can require a path in a method's parameters, and it is guaranteed that the passed path will be well-formed and will have certain properties.

Also, the methods in the library provide some qualities that are missing from the System.IO.Path: say, we aim to provide several ways of path normalization and comparison, the ones that will and will not perform disk IO to resolve paths on case-insensitive file systems.

The library is inspired by the path libraries used in other ecosystems: in particular, Java's java.nio.file.Path and Kotlin's extensions.

Read more on the documentation site.

If you miss some feature or have questions, do not hesitate to open an issue or go to the discussions section.

Name NuGet Package Documentation
TruePath TruePath on nuget.org API Reference
TruePath.SystemIo TruePath.SystemIo on nuget.org API Reference
TruePath.TestableIO.System.IO (third-party) TruePath.TestableIO.System.IO on nuget.org Documentation

TruePath provides two NuGet packages:

A third-party package, TruePath.TestableIO.System.IO, adds TestableIO.System.IO.Abstractions integration on top of TruePath.

Documentation

License

The project is distributed under the terms of the MIT license.

The license indication in the project's sources is compliant with the REUSE specification v3.3.

关于

File path abstraction library for .NET.

Topics

Resources

Contributing

Stars

105 stars

关注者

4 watching

复刻s

发布

Used by

贡献者

Languages