Dowser] is a(nother) fast, multi-threaded, 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 and hidden directories are followed like any other, including across devices;
- Matching file paths are canonicalized, deduped, and collected into a
If those things sound nice, this library might be a good fit.
On the other hand, [
Dowser] is optimized for just one particular type of searching:
- File paths can be filtered via [
Dowser::filtered] or [
Dowser::regex], but directory paths cannot;
- There are no settings for things like min/max depth, directory filtering, etc.;
- It only returns file paths. Directories are crawled, but not returned in the set;
- File uniqueness hashing relies on Unix metadata; this library is not compatible with Windows;
Depending on your needs, those limitations could be bad, in which case something like
Walkdir might make more sense.
dowser to your
||Enable the [
To use this feature, alter the
Cargo.toml bit to read:
This crate comes with two ways to find files. If you already have the full list of starting path(s) and just want all the files that exist under them, use the
If you want to filter files or need to add path(s) to the crawl list multiple times, initialize a [
Dowser] object with one of the following three methods:
Dowser::default]: Return all files without prejudice.
Dowser::filtered]: Filter file paths via the provided callback.
Dowser::regex]: Filter file paths via regular express. (This requires enabling the
From there, add one or more file or directory paths using the [
Dowser::with_path] and [
Finally, collect the results with
Vec::<PathBuf>::try_from(). If no files are found, an error is returned, otherwise the matching file paths are collected into a vector.
See also: CREDITS.md
Copyright © 2021 Blobfolio, LLC <[email protected]>
This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar <[email protected]> Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.