glob

Crates.ioglob
lib.rsglob
version0.3.1
sourcesrc
created_at2014-11-11 05:37:15.865977
updated_at2023-01-06 14:36:38.757028
descriptionSupport for matching file paths against Unix shell style patterns.
homepagehttps://github.com/rust-lang/glob
repositoryhttps://github.com/rust-lang/glob
max_upload_size
id8
size77,336
(rust-lang-owner)

documentation

https://docs.rs/glob/0.3.1

README

glob

Support for matching file paths against Unix shell style patterns.

Continuous integration

Documentation

Usage

To use glob, add this to your Cargo.toml:

[dependencies]
glob = "0.3.1"

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),
    }
}
Commit count: 209

cargo fmt