Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 3.26 KB

File metadata and controls

60 lines (45 loc) · 3.26 KB

Ramstack.FileSystem.Globbing

NuGet MIT

Provides an implementation of Ramstack.FileSystem that applies glob-based filtering rules to determine which files and directories of the underlying file system to include or exclude.

It relies on the Ramstack.Globbing package for its globbing capabilities.

Getting Started

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

dotnet add package Ramstack.FileSystem.Globbing

Usage

using Ramstack.FileSystem.Globbing;

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

// Include only "*.txt" files and "*.md" files in the "/docs" directory, excluding any "README.md" file
GlobbingFileSystem fs = new GlobbingFileSystem(fileSystem,
    patterns: ["**/*.txt", "docs/*.md"],
    excludes: ["**/README.md"]);

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.