mirror of
https://github.com/darakian/ddh.git
synced 2026-09-10 07:06:21 -04:00
Working on new directory traversal
This commit is contained in:
parent
9f16f8cece
commit
454c92ed26
14
src/main.rs
14
src/main.rs
|
|
@ -177,6 +177,20 @@ fn hash_and_send(file_path: &Path, sender: Sender<Fileinfo>) -> (){
|
|||
}
|
||||
}
|
||||
|
||||
// fn traverse_and_spawn(current_path: &Path, sender: Sender<Fileinfo>) -> (){
|
||||
// if current_path.is_file(){
|
||||
// hash_and_send(current_path, sender.clone());
|
||||
// } else if current_path.is_dir() {
|
||||
// vec![fs::read_dir(current_path).unwrap().unwrap().collect::<std::fs::DirEntry>()].par_iter().map(|dir_entry|{
|
||||
// if dir_entry.is_dir(){
|
||||
// traverse_and_spawn(dir_entry, sender.clone());
|
||||
// } else if dir_entry.is_file(){
|
||||
// hash_and_send(dir_entry, sender.clone());
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
fn collect_files(current_path: &Path, mut file_set: Vec<Fileinfo>, pool: ThreadPool, collection_sender: Sender<Vec<Fileinfo>>) -> Vec<Fileinfo> {
|
||||
//println!("Entering {:?}", current_path.to_str());
|
||||
if current_path.is_dir(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue