mirror of
https://git.proxmox.com/git/rustc
synced 2026-01-20 22:17:47 +00:00
| .. | ||
| examples | ||
| src | ||
| tests | ||
| .cargo-checksum.json | ||
| appveyor.yml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
GlobWalk
Recursively find files in a directory using globs.
Based on both walkdir & ignore (❤), this crate inherits many goodies from
both, such as limiting search depth and amount of open file descriptors.
Licensed under MIT.
Why not glob
- The
globcrate does not support having{a,b}in patterns. globwalkcan match several glob-patterns at the same time.globwalksupports excluding results with!.globsearches for files in the current working directory, whereasglobwalkstarts at a specified base-dir.
Usage
To use this crate, add globwalk as a dependency to your project's Cargo.toml:
[dependencies]
globwalk = "0.8.1"
The following piece of code recursively find all png, jpg, or gif files:
extern crate globwalk;
use std::fs;
for img in globwalk::glob("*.{png,jpg,gif}").unwrap() {
if let Ok(img) = img {
println!("{:?}", img.path());
}
}
See the documentation for more details.