Answers for "rust get all files in directory"

2

rust get all files in directory

use std::fs;

fn main() {
    let paths = fs::read_dir("./").unwrap();

    for path in paths {
        println!("Name: {}", path.unwrap().path().display())
    }
}
Posted by: Guest on March-01-2022

Code answers related to "rust get all files in directory"

Browse Popular Code Answers by Language