Skip to content
/ glob Public
forked from kthompson/glob

A C# Glob library for .NET and .NET Core.

License

Notifications You must be signed in to change notification settings

timbell/glob

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glob

Build status Nuget

A C# Glob library for .NET and .NET Core.

What is a glob?

A glob is a pattern-matching syntax that shells use. Like when you do rm *.cs, the *.cs is a glob.

See: http://en.wikipedia.org/wiki/Glob_(programming) for more info.

Supported Environments

  • Windows
  • Macintosh OS X (Darwin)
  • Linux

Why another glob library?

From all of my searching I have not been able to find a glob utility that works on Windows and *nix. If you need something that works on all platforms... This is what you need.

This is also a pure C# implementation.

Usage

Example

var glob = new Glob("**/bin");
var match = glob.IsMatch(@"C:\files\bin\");

Static Usage

var match = Glob.IsMatch(@"C:\files\bin\", "**/bin");	

Extension Methods

DirectoryInfo.GlobDirectories

Enumerate through all matching directories recursively.

Params

  • pattern: String

Example

var root = new DirectoryInfo(@"C:\");
var allBinFolders = root.GlobDirectories("**/bin");

DirectoryInfo.GlobFiles

Enumerate through all matching files recursively.

Params

  • pattern: String

Example

var root = new DirectoryInfo(@"C:\");
var allDllFiles = root.GlobFiles("**/*.dll");

DirectoryInfo.GlobFileSystemInfos

Enumerate through all matching files and folders recursively.

Params

  • pattern: String

Example

var root = new DirectoryInfo(@"C:\");
var allInfoFilesAndFolders = root.GlobFileSystemInfos("**/*info");

About

A C# Glob library for .NET and .NET Core.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%