StaticCs.PathRoot 0.1.1

dotnet add package StaticCs.PathRoot --version 0.1.1
                    
NuGet\Install-Package StaticCs.PathRoot -Version 0.1.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="StaticCs.PathRoot" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StaticCs.PathRoot" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="StaticCs.PathRoot" />
                    
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 StaticCs.PathRoot --version 0.1.1
                    
#r "nuget: StaticCs.PathRoot, 0.1.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 StaticCs.PathRoot@0.1.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=StaticCs.PathRoot&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=StaticCs.PathRoot&version=0.1.1
                    
Install as a Cake Tool

StaticCs.PathRoot

PathRoot provides filesystem operations rooted at an open directory handle. Paths passed to a PathRoot are relative to that directory and cannot escape it through .. components or symbolic links.

using StaticCs;

using PathRoot root = PathRoot.Open("/srv/work");
string logs = Path.Combine("output", "logs");
using PathRoot logRoot = root.CreateSubRoot(logs);

using FileStream stream = logRoot.CreateFile("build.log");

Use OpenSubRoot to derive a root confined to a subdirectory:

using PathRoot output = root.OpenSubRoot("output");
using FileStream stream = output.CreateFile("result.txt");

The API uses file- and directory-specific .NET-style names, including CreateDirectory, CreateSubRoot, CreateFileSymbolicLink, CreateDirectorySymbolicLink, CreateHardLink, MoveFile, MoveDirectory, DeleteFile, DeleteDirectory, and GetSymbolicLinkTarget.

Both paths passed to CreateHardLink are relative to the root. The target must be on the same filesystem as the new link. If the target is a symbolic link, the hard link refers to the symbolic link itself rather than traversing it.

The root remains attached to the directory that was opened even if that directory is subsequently renamed. Operations may traverse mount points and may open device or other special files. On Windows, unknown reparse-point types are rejected, and creating a symbolic link may require SeCreateSymbolicLinkPrivilege.

Confinement remains enforced while other processes modify the tree. As with the corresponding File and Directory APIs, file-versus-directory errors are not guaranteed if another process replaces the final entry during an operation.

Product 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.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 38 9/19/2026
0.1.0 45 9/19/2026