Parallelized directory size calculation
https://crates.io/crates/dir-size
| LICENSES | ||
| src | ||
| .gitignore | ||
| .woodpecker.yaml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| COPYING | ||
| README.md | ||
dir-size
dir-size is a crate that calculates directory size in parallel using rayon.
Usage
This is a little code sample:
use dir_size::{get_size_in_bytes, get_size_in_human_bytes, get_size_in_abbr_human_bytes};
use std::{io, path::Path};
fn main() -> io::Result<()> {
let path = Path::new("/home");
println!("{} Bytes", get_size_in_bytes(path)?);
println!("{}", get_size_in_human_bytes(path)?);
println!("{}", get_size_in_abbr_human_bytes(path)?);
Ok(())
}