Barugon / egui_file

File dialog for egui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't change driver letter in windows

willser opened this issue · comments

commented

Hi.
It's seems can't change driver letter in windows.

image

Up button is disable when path is root of driver.

commented

I think it is possible to add a judgment on whether it is Windows or not to this code, and if so, try to get all the driverr letters.Is right that?I wanted to make a PR, but I was afraid that my idea would be wrong

egui_file/src/lib.rs

Lines 567 to 578 in c97c202

fn read_folder(path: &Path) -> Result<Vec<PathBuf>, Error> {
match fs::read_dir(path) {
Ok(paths) => {
let mut result: Vec<PathBuf> = paths
.filter_map(|result| result.ok())
.map(|entry| entry.path())
.collect();
result.sort_by(|a, b| a.file_name().cmp(&b.file_name()));
Ok(result)
}
Err(e) => Err(e),
}

For now, I believe that you can change the drive letter in the path edit. I'll try out your idea in Wine when I get a bit of time.

@willser, can you give the latest a try? It works for me under Wine but I just want to make sure.