Skip to content

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.

Speed test removes its test folders when it is done

gelenmedyad3b8de95a7a7
diff --git a/crates/rf-app/src/bench.rs b/crates/rf-app/src/bench.rs
index 8c899a07..7cd9e3dc 100644
--- a/crates/rf-app/src/bench.rs
+++ b/crates/rf-app/src/bench.rs
@@ -544,6 +544,13 @@ pub fn run(plan: &Plan, progress: &dyn Fn(Progress), cancel: &AtomicBool) -> any
let when = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.as_millis() as i64);
let r = Results { when, version: crate::installer::version(), machine, open, engines };
let _ = std::fs::write(root.join("results.json"), serde_json::to_vec_pretty(&r).unwrap_or_default());
+ // the test folders (over a gigabyte) are not left behind: only the results stay; the next test makes them again
+ if let Ok(rd) = std::fs::read_dir(&root) {
+ for e in rd.flatten().filter(|e| e.file_name() != "results.json") {
+ let p = e.path();
+ let _ = if p.is_dir() { std::fs::remove_dir_all(&p) } else { std::fs::remove_file(&p) };
+ }
+ }
Ok(r)
}