-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Milestone
Description
Here's a recursive file list:
$find src
src/
src/main.rs
src/a/
src/a/b.rs
Running this program
extern crate glob;
use std::path::Path;
use glob::{Pattern,glob};
fn main() {
let pattern="src/*.rs";
println!("matches src/a/b.rs: {}",Pattern::new(pattern).unwrap().matches_path(Path::new("src/a/b.rs")));
for entry in glob(pattern).unwrap() {
println!("globbed: {}", entry.unwrap().display());
}
}
outputs
matches src/a/b.rs: true
globbed: src/main.rs
Note it DID NOT output globbed: src/a/b.rs. Meaning glob and Pattern::matches_path are inconsistent here. I think glob is correct as '*' should not match across slashes.
Metadata
Metadata
Assignees
Labels
No labels