Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

search in dir rust

use std::fs;

fn is_file(name: String) -> bool {
    let paths = fs::read_dir("").unwrap();
    for path in paths {
        let dir_name = path.unwrap().path().into_os_string().into_string().unwrap();
        if dir_name == name {
            return true
        }
    }
    return false
}
 
PREVIOUS NEXT
Tagged: #search #dir #rust
ADD COMMENT
Topic
Name
9+3 =