feat: add ability to list pwd

This commit is contained in:
2021-07-09 11:34:56 -04:00
parent e1b5e2f3c7
commit 002fff3eb4
3 changed files with 25 additions and 0 deletions

12
src/main.rs Normal file
View File

@@ -0,0 +1,12 @@
use std::fs;
fn main() {
let paths = fs::read_dir(".").unwrap();
for result in paths {
let path = result.unwrap().path();
let metadata = fs::metadata(path.to_str().unwrap()).unwrap();
let type_ = if metadata.is_dir() { "Dirc" } else { "File" };
println!("{}: {}", type_, path.display())
}
}