KSXGitHub / parallel-disk-usage

Highly parallelized, blazing fast directory tree analyzer
https://crates.io/crates/parallel-disk-usage
Apache License 2.0
445 stars 11 forks source link

Example to use parallel-disk-usage as a crate. #246

Closed tbellembois closed 1 year ago

tbellembois commented 1 year ago

Hi,

I would like to use parallel-disk-usage in one of my projet but I can't figure out how to use it. Any example ?

Thanks

KSXGitHub commented 1 year ago

As a crate

If you are trying to build a pdu-styled ASCII graph for your own data, see Visualizer. You will need to supply it a DataTree.

If you are trying to create your own visualization for the data that is provided by pdu, see DataTree.

As a program

There are --json-input and --json-output flags.

The examples

The only examples are this repository in its entirety or whatever I provided on docs.rs.

tbellembois commented 1 year ago

DataTree is what I was looking for.

    let children = data_tree.children();
    let data = data_tree.data();

    debug!("data: {:?}", data);
    debug!("children: {:#?}", children);

Is there a way to limit the children depth?

Regards

KSXGitHub commented 1 year ago

Is there a way to limit the children depth?

Visualizer has max_depth.

tbellembois commented 1 year ago

This works like a charm. Thanks !