Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 3.08 KB

File metadata and controls

56 lines (42 loc) · 3.08 KB

Ramstack.FileSystem.Sub

NuGet MIT

Provides an implementation of Ramstack.FileSystem that wraps an underlying file system for managing files under a specific subpath.

Getting Started

To install the Ramstack.FileSystem.Sub NuGet package in your project, run the following command:

dotnet add package Ramstack.FileSystem.Sub

Usage

using Ramstack.FileSystem.Sub;

IVirtualFileSystem fileSystem = new PhysicalFileSystem(@"C:\project");

// Restrict the file system to only the contents within the "/app/assets" directory
// of the parent file system. Files and directories above the specified path will be inaccessible.
SubFileSystem fs = new SubFileSystem(path: "/app/assets", fileSystem);

await foreach (VirtualFile file in fs.GetFilesAsync("/"))
{
    Console.WriteLine(file.FullName);
}

Related Projects

Supported versions

Version
.NET 6, 7, 8, 9, 10

Contributions

Bug reports and contributions are welcome.

License

This package is released as open source under the MIT License. See the LICENSE file for more details.