#prompt #user #file #pick #directory #interactively #label

file_picker

Prompts the user to pick a file interactively from the current directory

5 unstable releases

new 0.3.2 Nov 20, 2024
0.2.2 Nov 20, 2024
0.2.1 Nov 17, 2024
0.2.0 Nov 16, 2024
0.1.0 Nov 15, 2024

#2 in #interactively

Download history 261/week @ 2024-11-13

262 downloads per month

MIT/Apache

66KB
2.5K SLoC

Prompts the user to pick a file interactively from the current directory.

Arguments

  • label - A string slice that holds the prompt label to display to the user.

Returns

  • std::io::Result<PathBuf> - Returns the PathBuf of the selected file.

Examples

fn main() -> std::io::Result<()> {
    let file_path = file_picker::file_picker("Select a file:")?;
    println!("You selected the file: {}", file_path.display());

    let dir_path = file_picker::dir_picker("Select a directory:")?;
    println!("You selected the directory: {}", dir_path.display());
}

Dependencies

~2.2–9.5MB
~97K SLoC