mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Support listing directories by number of files
Based of https://github.com/bootandy/dust/pull/104 Idea is to allow users to find the number of files in each directory instead of size.
This commit is contained in:
+3
-1
@@ -109,6 +109,7 @@ pub fn get_dir_tree<P: AsRef<Path>>(
|
||||
ignore_directories: &Option<Vec<PathBuf>>,
|
||||
apparent_size: bool,
|
||||
limit_filesystem: bool,
|
||||
by_filecount: bool,
|
||||
max_depth: Option<usize>,
|
||||
) -> (bool, HashMap<PathBuf, u64>) {
|
||||
let (tx, rx) = channel::bounded::<PathData>(1000);
|
||||
@@ -144,7 +145,8 @@ pub fn get_dir_tree<P: AsRef<Path>>(
|
||||
|
||||
match maybe_size_and_inode {
|
||||
Some(data) => {
|
||||
let (size, inode_device) = data;
|
||||
let (size, inode_device) =
|
||||
if by_filecount { (1, data.1) } else { data };
|
||||
txc.send((p.into_path(), size, inode_device)).unwrap();
|
||||
}
|
||||
None => {
|
||||
|
||||
Reference in New Issue
Block a user