Crates.io | glob-sl |
lib.rs | glob-sl |
version | 0.4.2 |
source | src |
created_at | 2023-04-25 20:29:59.11299 |
updated_at | 2023-09-10 05:46:32.46687 |
description | Support for matching file paths against Unix shell style patterns. |
homepage | https://github.com/brmmm3/glob-sl |
repository | https://github.com/brmmm3/glob-sl |
max_upload_size | |
id | 848795 |
size | 79,211 |
Support for matching file paths against Unix shell style patterns.
This crate is a fork of the glob crate. The only difference is that glob-rs add option follow_links to MatchOptions.
To use glob-sl
, add this to your Cargo.toml
:
[dependencies]
glob-sl = "0.4.2"
And add this to your crate root:
extern crate glob_sl;
Print all jpg files in /media/ and all of its subdirectories.
use glob_sl::glob;
for entry in glob("/media/**/*.jpg").expect("Failed to read glob pattern") {
match entry {
Ok(path) => println!("{:?}", path.display()),
Err(e) => println!("{:?}", e),
}
}