#size #directory #file

dir-size

Parallelized directory size calculation

2 releases

0.1.1 Dec 7, 2024
0.1.0 Nov 25, 2024

#549 in Filesystem

Download history 114/week @ 2024-11-20 36/week @ 2024-11-27 149/week @ 2024-12-04 67/week @ 2024-12-11 24/week @ 2024-12-18 91/week @ 2024-12-25 27/week @ 2025-01-15

118 downloads per month

MPL-2.0 license

9KB
109 lines

dir-size

status-badge

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(())
}

Dependencies

~1.5MB
~25K SLoC