TedToolkit.FileSystem 2026.9.11.1

dotnet add package TedToolkit.FileSystem --version 2026.9.11.1
                    
NuGet\Install-Package TedToolkit.FileSystem -Version 2026.9.11.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TedToolkit.FileSystem" Version="2026.9.11.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TedToolkit.FileSystem" Version="2026.9.11.1" />
                    
Directory.Packages.props
<PackageReference Include="TedToolkit.FileSystem" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TedToolkit.FileSystem --version 2026.9.11.1
                    
#r "nuget: TedToolkit.FileSystem, 2026.9.11.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TedToolkit.FileSystem@2026.9.11.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TedToolkit.FileSystem&version=2026.9.11.1
                    
Install as a Cake Addin
#tool nuget:?package=TedToolkit.FileSystem&version=2026.9.11.1
                    
Install as a Cake Tool

TedToolkit.FileSystem

TedToolkit.FileSystem provides small, strongly typed file system value objects for .NET while keeping the API close to System.IO.

Instead of passing raw strings everywhere, you can work with explicit path-focused values:

  • FileName
  • FilePath
  • DirectoryPath

The library is designed as a thin forwarding layer. Most members map directly to a corresponding BCL API.

Install

dotnet add package TedToolkit.FileSystem

Why Use It

  • Model file system values explicitly instead of passing ambiguous string parameters.
  • Keep familiar Path, File, and Directory shaped operations close to the value you are already working with.
  • Stay lighter than FileInfo and DirectoryInfo when you mainly want to pass around path values.
  • Adopt stronger file system semantics without introducing a custom abstraction model on top of the BCL.

Quick Start

using TedToolkit.FileSystem;

var root = DirectoryPath.CurrentDirectory;
var logs = root / "logs";
var logFile = logs / "app".AsFileName("log");

logs.Create();
logFile.WriteAllText("Started");

Console.WriteLine(logFile.FullName);
Console.WriteLine(logFile.Extension);

Core Types

FileName

Represents a file name value.

using TedToolkit.FileSystem;

FileName report = "report".AsFileName("txt");

Console.WriteLine(report.Name);

The extension argument follows Path.ChangeExtension semantics, so both "txt" and ".txt" are valid.

DirectoryPath

Represents a directory path and exposes directory-oriented operations.

using TedToolkit.FileSystem;

var root = DirectoryPath.CurrentDirectory;
var artifacts = root / "artifacts";

artifacts.Create();

foreach (var file in artifacts.EnumerateFiles("*.json"))
{
    Console.WriteLine(file.FullName);
}

FilePath

Represents a file path and exposes file-oriented operations.

using TedToolkit.FileSystem;

var root = DirectoryPath.CurrentDirectory;
var file = root / "notes".AsFileName("txt");

file.WriteAllText("Hello from TedToolkit.FileSystem");

Console.WriteLine(file.ReadAllText());
Console.WriteLine(file.Name);
Console.WriteLine(file.NameWithoutExtension);
Console.WriteLine(file.ParentDirectory);

Common Usage

Build paths fluently

using TedToolkit.FileSystem;

var configDirectory = DirectoryPath.ApplicationData / "MyApp";
var configFile = configDirectory / "settings".AsFileName("json");

Resolve absolute and relative paths

using TedToolkit.FileSystem;

var root = DirectoryPath.CurrentDirectory;
var relativeFile = new FilePath(@"data\sample.txt");

var absoluteFile = relativeFile.GetFullPath(root);
var relativeAgain = absoluteFile.GetRelativePath(root);

Console.WriteLine(absoluteFile.FullName);
Console.WriteLine(relativeAgain.FullName);

Use BCL-shaped file operations from FilePath

using TedToolkit.FileSystem;

var source = new FilePath("report.txt");
var backup = source.ChangeExtension(".bak");

source.CopyTo(backup, overwrite: true);

Convert to FileInfo when needed

using TedToolkit.FileSystem;

var file = new FilePath(@"artifacts\report.json");

Console.WriteLine(file.ToFileInfo().Length);

Design Principles

  • Public APIs stay intentionally close to Path, File, Directory, FileInfo, and DirectoryInfo.
  • The library favors direct forwarding over custom validation, compatibility emulation, or higher-level workflows.
  • Some members are available only on target frameworks where the wrapped BCL member exists.
  • The goal is stronger typing and fluent composition, not replacing the BCL with a new file system model.

Target Frameworks

TedToolkit.FileSystem targets:

  • net6.0
  • net7.0
  • net8.0
  • net9.0
  • net10.0
  • net472
  • net48
  • netstandard2.0
  • netstandard2.1

License

Licensed under LGPL-3.0.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on TedToolkit.FileSystem:

Package Downloads
TedToolkit.FileSystem.ProjectPaths

Generates strongly typed file system paths for a Git work tree.

TedToolkit.CiContext

Provider-neutral primitives for strongly typed CI process environment contexts.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.9.11.1 126 9/11/2026
2026.9.11 122 9/11/2026
2026.8.3 164 8/3/2026
2026.7.15 253 7/15/2026
2026.7.5 124 7/5/2026