Logo

Programming-Idioms

History of Idiom 212 > diff from v8 to v9

Edit summary for version 9 by cedricg:
New Rust implementation by user [cedricg]

Version 8

2019-11-04, 18:57:05

Version 9

2020-03-11, 15:43:59

Idiom #212 Check if folder exists

Set boolean b to true if path exists on the filesystem and is a directory; false otherwise.

Idiom #212 Check if folder exists

Set boolean b to true if path exists on the filesystem and is a directory; false otherwise.

Extra Keywords
test whether existence
Extra Keywords
test whether existence
Imports
use std::path::Path;
Code
fn main() {
	let _exists: bool = Path::new("/path/to/folder").exists();
}
Doc URL
https://doc.rust-lang.org/std/path/struct.Path.html#method.exists
Origin
https://stackoverflow.com/questions/32384594/how-to-check-whether-a-path-exists