Code Monkey home page Code Monkey logo

glob-1's Introduction

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");

glob-1's People

Contributors

dazinator avatar kthompson avatar nickjosevski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.