Crates.io | dir-size |
lib.rs | dir-size |
version | 0.1.1 |
source | src |
created_at | 2024-11-25 17:41:14.674805 |
updated_at | 2024-12-07 05:22:53.063138 |
description | Parallelized directory size calculation |
homepage | https://codeberg.org/Integral/dir-size |
repository | https://codeberg.org/Integral/dir-size |
max_upload_size | |
id | 1460533 |
size | 40,732 |
dir-size
is a crate that calculates directory size in parallel using rayon
.
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(())
}