https://github.com/blobfolio/dowser
A multi-threaded, recursive file finding library for Unix/Rust.
https://github.com/blobfolio/dowser
file-traversal recursive rust
Last synced: about 2 months ago
JSON representation
A multi-threaded, recursive file finding library for Unix/Rust.
- Host: GitHub
- URL: https://github.com/blobfolio/dowser
- Owner: Blobfolio
- License: wtfpl
- Created: 2021-02-22T04:08:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-25T21:39:22.000Z (3 months ago)
- Last Synced: 2025-04-12T13:45:51.316Z (about 2 months ago)
- Topics: file-traversal, recursive, rust
- Language: Rust
- Homepage:
- Size: 229 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Dowser
[](https://docs.rs/dowser/)
[](https://github.com/Blobfolio/dowser/blob/master/CHANGELOG.md)
[](https://crates.io/crates/dowser)
[](https://github.com/Blobfolio/dowser/actions)
[](https://deps.rs/repo/github/blobfolio/dowser)
[](https://en.wikipedia.org/wiki/WTFPL)
[](https://github.com/Blobfolio/dowser/issues)`Dowser` is a(nother) fast, recursive file-finding library for Unix/Rust. It differs from [`Walkdir`](https://crates.io/crates/walkdir) and kin in a number of ways:
* It is not limited to one root; any number of file and directory paths can be loaded and traversed en masse;
* Symlinks are followed by default, but can be disabled using `Dowser::without_symlinks`;
* Hidden paths and mount points are traversed like anything else;
* Matching file paths are canonicalized and deduped before yielding;If those things sound nice, this library might be a good fit.
On the other hand, `Dowser` is optimized for _file_ searching; the iterator crawls but does not yield directory paths, which could be bad if you need those too. Haha.
## Installation
Add `dowser` to your `dependencies` in `Cargo.toml`, like:
```
[dependencies]
dowser = "0.12.*"
```## Example
All you need to do is chain `Dowser::default` with one or more of the following seed methods:
* `Dowser::with_path` / `Dowser::with_paths`
* `Dowser::without_path` / `Dowser::without_paths`From there, you can apply any `Iterator` methods you want.
```rust
use dowser::Dowser;
use std::path::PathBuf;// Return all files under "/usr/share/man".
let files1: Vec:: = Dowser::default()
.with_path("/usr/share/man")
.collect();// Return only Gzipped files using callback filter.
let files1: Vec:: = Dowser::default()
.with_path("/usr/share/man")
.filter(|p|
p.extension().is_some_and(|e| e.eq_ignore_ascii_case("gz"))
)
.collect();
```