StaticCs.PathRoot
0.1.1
dotnet add package StaticCs.PathRoot --version 0.1.1
NuGet\Install-Package StaticCs.PathRoot -Version 0.1.1
<PackageReference Include="StaticCs.PathRoot" Version="0.1.1" />
<PackageVersion Include="StaticCs.PathRoot" Version="0.1.1" />
<PackageReference Include="StaticCs.PathRoot" />
paket add StaticCs.PathRoot --version 0.1.1
#r "nuget: StaticCs.PathRoot, 0.1.1"
#:package StaticCs.PathRoot@0.1.1
#addin nuget:?package=StaticCs.PathRoot&version=0.1.1
#tool nuget:?package=StaticCs.PathRoot&version=0.1.1
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 | 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. 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. |
-
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.