A cross-platform picker for access files and folders
Add picker
as a dependency in your Cargo.toml
:
[dependencies]
picker = "0.1.1"
Pick a single file:
use picker::FileOpenPicker;
fn main() {
if let Ok(option) = FileOpenPicker::new()
.file_type_filter(&["zip", "dmg"])
.file_type_filter(&["png", "jpg"])
.pick_single_file()
{
if let Some(path) = option {
println!("Path is {}.", path);
}
}
}
- macOS
- Windows
- Linux