workhorsy / d-glob

Search file systems with glob patterns using the D programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

D Glob

Search file systems with glob patterns using the D programming language

Example

import std.stdio : stdout;
import glob : glob, globRegex;


// Use glob to search by glob pattern
foreach (entry ; glob("/usr/*/python*")) {
	stdout.writefln("%s", entry);
}

/*
/usr/bin/python2
/usr/bin/python2.7
/usr/bin/python3
/usr/bin/python3.5
/usr/lib/python2.7
/usr/lib/python3
/usr/lib/python3.5
*/

// Use globRegex to search by regex pattern
foreach (entry ; globRegex(`^/proc/[0-9]*$`)) {
	stdout.writefln("%s", entry);
}
/*
/proc/111
/proc/245
/proc/19533
/proc/1
*/

Documentation

https://workhorsy.github.io/d-glob/0.4.0/

Generate documentation

dub --build=docs

Run unit tests

dub test

Dub version Dub downloads License

About

Search file systems with glob patterns using the D programming language

License:Boost Software License 1.0


Languages

Language:D 95.4%Language:Shell 4.6%