Answers for "rust current directory list files"

0

rust current directory list files

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 July-27-2021

Code answers related to "rust current directory list files"

Browse Popular Code Answers by Language