TruePath 1.7.0
dotnet add package TruePath --version 1.7.0
NuGet\Install-Package TruePath -Version 1.7.0
<PackageReference Include="TruePath" Version="1.7.0" />
<PackageVersion Include="TruePath" Version="1.7.0" />
<PackageReference Include="TruePath" />
paket add TruePath --version 1.7.0
#r "nuget: TruePath, 1.7.0"
#addin nuget:?package=TruePath&version=1.7.0
#tool nuget:?package=TruePath&version=1.7.0
TruePath 
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.
Packages
Name | Badge |
---|---|
TruePath | |
TruePath.SystemIo |
TruePath provides two NuGet packages:
- TruePath for the main path abstractions,
- TruePath.SystemIo for the
System.IO
integration.
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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on TruePath:
Package | Downloads |
---|---|
Fenrir.Git
Fenrir is a .NET library to work with Git repositories. It provides functions to read Git objects, traverse the commit graph, extract trees and files from any commit, etc. Essentially, it provides tools to create your own Git client, or transform a repository in any way. |
|
TruePath.SystemIo
Adapters to use System.IO.File and System.IO.Directory APIs together with TruePath. |
GitHub repositories
This package is not used by any popular GitHub repositories.
[Added]
- A new package, TruePath.SystemIo, with adapter for System.IO types.
TruePath.SystemIo.PathIo contains most of the static methods from .NET's File and Directory types as extension methods over the AbstractPath.
Thanks to @kant2002!