Working on new directory traversal

This commit is contained in:
Jon Moroney 2018-02-16 18:11:34 +01:00
parent 9f16f8cece
commit 454c92ed26

View file

@ -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(){