Filesystem walk.
Add this to your Cargo.toml
:
toml
[dependencies]
jwalk = "0.1.0"
Lean More: docs.rs/jwalk
Recursively iterate over the "foo" directory sorting by name:
```rust use jwalk::{WalkDir};
for entry in WalkDir::new("foo").sort(true) { println!("{}", entry?.path().display()); } ```
This crate is inspired by both walkdir
and
ignore
. It attempts to combine the
parallelism of ignore
with walkdir
's streaming iterator API.
This crate is particularly fast when you want streamed sorted results. In my
tests its about 4x walkdir
speed for sorted results with metadata. Also this
crate's process_entries
callback allows you to arbitrarily sort/filter/skip
entries before they are yielded.
Directory traversal is already pretty fast. If you don't need this crate's speed
then walkdir
provides a smaller and more tested single threaded
implementation.
Benchmarks
comparing this crate with jwalk
and ignore
.