check if a file exists rust

249

check if a file exists rust -

use std::path::Path;

fn main() {
    println!("{}", Path::new("/etc/hosts").exists());
}

Comments

Submit
0 Comments