|
|
@@ -0,0 +1,18 @@
|
|
|
+use std::fs;
|
|
|
+use std::path::Path;
|
|
|
+
|
|
|
+fn main() {
|
|
|
+ let dir_path = "E:\\Users\\cleme\\Downloads";
|
|
|
+ recursive(dir_path)
|
|
|
+}
|
|
|
+fn recursive<P: AsRef<Path>>(path: P) {
|
|
|
+ if let Ok(entrie) = fs::read_dir(path) {
|
|
|
+ for entry in entrie{
|
|
|
+ if let Ok(entry_ok) = entry {
|
|
|
+ if let Ok(file_type) = entry_ok.file_type() {
|
|
|
+ println!("{:?} : {:?}",entry_ok.path(), file_type.is_dir())
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|