Skip to content

A multi-threaded, recursive file finding library for Unix/Rust.

License

Notifications You must be signed in to change notification settings

Blobfolio/dowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4058570 · Feb 25, 2025
Mar 21, 2024
Feb 25, 2025
Feb 25, 2025
Feb 25, 2025
Mar 25, 2022
Feb 22, 2021
Mar 10, 2021
Feb 25, 2025
Feb 25, 2025
Feb 25, 2025
Feb 22, 2021
Feb 25, 2025
Sep 2, 2024

Repository files navigation

Dowser

docs.rs changelog
crates.io ci deps.rs
license contributions welcome

Dowser is a(nother) fast, recursive file-finding library for Unix/Rust. It differs from 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.

use dowser::Dowser;
use std::path::PathBuf;

// Return all files under "/usr/share/man".
let files1: Vec::<PathBuf> = Dowser::default()
    .with_path("/usr/share/man")
    .collect();

// Return only Gzipped files using callback filter.
let files1: Vec::<PathBuf> = Dowser::default()
    .with_path("/usr/share/man")
    .filter(|p|
        p.extension().is_some_and(|e| e.eq_ignore_ascii_case("gz"))
    )
    .collect();