A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.
Rust archive-managerdesktop-appdual-paneexplorer-alternativefile-browserfile-explorerfile-managerfluent-designgpu-acceleratedgpuimacosmicaproductivityquick-lookrustrust-guitabswindowswindows-11windows-explorer
An external hard disk can be ejected: the eject no longer refuses a fixed disk on an outside bus (622)
gelenmedyaf988f0b072d6
diff --git a/crates/rf-win/src/volume.rs b/crates/rf-win/src/volume.rsindex e83a0713..76d25b47 100644--- a/crates/rf-win/src/volume.rs+++ b/crates/rf-win/src/volume.rs@@ -151,6 +151,17 @@ pub fn removable_drives() -> Vec<(char, String)> {.collect()}+/// Whether a drive of this type (`GetDriveTypeW`) may be asked to eject: one with removable media (2), a disc drive (5), and a+/// fixed disk (3) on an outside bus.+///+/// WHY the last one (issue 622, the log of 2026-12-04: "E: sürücüsü çıkarılabilir değil"). An external hard disk or SSD reports+/// itself as a FIXED disk. The sidebar and the Dock have offered to eject such a disk since discussion 762, as File Explorer+/// does, but this check still took only removable media, so the eject of an external disk was refused before Windows was even+/// asked, every time. Pure.+pub fn may_eject(drive_type: u32, external: bool) -> bool {+ matches!(drive_type, 2 | 5) || (drive_type == 3 && external)+}+/// Fails when files are still open on the drive.pub fn eject(drive_letter: char) -> anyhow::Result<()> {let letter = drive_letter.to_ascii_uppercase();@@ -158,7 +169,7 @@ pub fn eject(drive_letter: char) -> anyhow::Result<()> {let root = format!("{letter}:\\");let rw = wide(&root);let t = unsafe { GetDriveTypeW(PCWSTR(rw.as_ptr())) };- anyhow::ensure!(t == 2 || t == 5, "{letter}: sürücüsü çıkarılabilir değil");+ anyhow::ensure!(may_eject(t, t == 3 && crate::drives::external_bus(letter)), "{letter}: sürücüsü çıkarılabilir değil");ensure_com();unsafe {@@ -198,6 +209,16 @@ mod tests {assert_eq!(v.serial_string().len(), 9);}+ #[test]+ fn an_external_disk_may_be_ejected_and_an_internal_one_may_not() {+ assert!(may_eject(2, false), "a USB stick, a card");+ assert!(may_eject(5, false), "a disc drive");+ assert!(may_eject(3, true), "an external hard disk: fixed, on an outside bus (issue 622)");+ assert!(!may_eject(3, false), "an internal disk");+ assert!(!may_eject(4, false) && !may_eject(4, true), "a network drive");+ assert!(!may_eject(0, true) && !may_eject(1, true));+ }+#[test]fn eject_rejects_fixed_drive() {// Safe: C: is a fixed disk, so this must fail before touching the shell.