commit | 75a976657b7a42a5fca3dd3c4d655ec9a809993e | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Sat Feb 20 00:24:19 2021 -0800 |
committer | Xin Li <delphij@google.com> | Sat Feb 20 00:24:19 2021 -0800 |
tree | 28ded3e268f7970c9b9a5b9e1dfed07c37063f29 | |
parent | f4cc93fbbb02c644b276eb48e5172e5b71d5f0cf [diff] | |
parent | 27d7d8c5a65f166b74917b4e605cd72e9c2a3d7e [diff] |
Mark ab/7061308 as merged in stage. Bug: 180401296 Merged-In: Ide4ea6df226e29d038bf758c797c711957d37a53 Change-Id: I4848c71616126fa72f66137921f7b85f3672fa73
Support for matching file paths against Unix shell style patterns.
To use glob
, add this to your Cargo.toml
:
[dependencies] glob = "0.3.0"
And add this to your crate root:
extern crate glob;
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), } }