You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 years ago | |
|---|---|---|
| .. | ||
| src | 3 years ago | |
| tests | 3 years ago | |
| .cargo_vcs_info.json | 3 years ago | |
| .gitignore | 3 years ago | |
| .travis.yml | 3 years ago | |
| Android.bp | 3 years ago | |
| Cargo.toml | 3 years ago | |
| Cargo.toml.orig | 3 years ago | |
| LICENSE | 3 years ago | |
| LICENSE-APACHE | 3 years ago | |
| LICENSE-MIT | 3 years ago | |
| METADATA | 3 years ago | |
| MODULE_LICENSE_APACHE2 | 3 years ago | |
| OWNERS | 3 years ago | |
| README.md | 3 years ago | |
| TEST_MAPPING | 3 years ago | |
README.md
glob
Support for matching file paths against Unix shell style patterns.
Usage
To use glob, add this to your Cargo.toml:
[dependencies]
glob = "0.3.0"
And add this to your crate root:
extern crate glob;
Examples
Print all jpg files in /media/ and all of its subdirectories.
use glob::glob;
for entry in glob("/media/**/*.jpg").expect("Failed to read glob pattern") {
match entry {
Ok(path) => println!("{:?}", path.display()),
Err(e) => println!("{:?}", e),
}
}