diff --git a/src/main.rs b/src/main.rs index 7c49d8214f..71da951d33 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,6 +30,11 @@ fn disk_paths() -> Result, String> { if let Ok(path_str) = path.into_os_string().into_string() { let scheme = path_str.trim_start_matches(':').trim_matches('/'); if scheme.starts_with("disk") { + if scheme == "disk/live" { + // Skip live disks + continue; + } + schemes.push(format!("{}:", scheme)); } } @@ -49,11 +54,19 @@ fn disk_paths() -> Result, String> { match fs::read_dir(&scheme) { Ok(entries) => for entry_res in entries { if let Ok(entry) = entry_res { - if let Ok(path) = entry.path().into_os_string().into_string() { - if let Ok(metadata) = entry.metadata() { - let size = metadata.len(); - if size > 0 { - paths.push((path, size)); + if let Ok(file_name) = entry.file_name().into_string() { + if file_name.contains('p') { + // Skip partitions + continue; + } + + if let Ok(path) = entry.path().into_os_string().into_string() { + if let Ok(metadata) = entry.metadata() { + let size = metadata.len(); + if size > 0 { + //TODO: check if root redoxfs + paths.push((path, size)); + } } } }