Check If A File Exists Rust

[Solved] Check If A File Exists Rust | Rust - Code Explorer | yomemimo.com
Question : check if a file exists rust

Answered by : ali-ahmed

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

Source : https://stackoverflow.com/questions/32384594/how-to-check-whether-a-path-exists | Last Update : Sun, 25 Oct 20

Answers related to check if a file exists rust

Code Explorer Popular Question For Rust