From c0faf43bea78dc144b4a4193eca73d4d3de769db Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 22:39:32 +0000 Subject: [PATCH] big_psb: remove a failed fixture only in the fresh default folder --- crates/psd/examples/big_psb.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/psd/examples/big_psb.rs b/crates/psd/examples/big_psb.rs index b204937df8a..71809802b78 100644 --- a/crates/psd/examples/big_psb.rs +++ b/crates/psd/examples/big_psb.rs @@ -42,8 +42,12 @@ fn main() -> std::io::Result<()> { for case in PSB_CASES.iter().chain([&PSD_2GB]).filter(|c| wanted.is_empty() || wanted.iter().any(|w| w == c.name)) { let path = out.join(case.file_name()); let t = std::time::Instant::now(); + // In the fresh default folder only: a half-written fixture is removed, but never a file an + // operator-chosen folder already held. let len = case.write_file(&path).inspect_err(|_| { - let _ = std::fs::remove_file(&path); // no half-written fixture left behind + if args.is_empty() { + let _ = std::fs::remove_file(&path); + } })?; println!("{}: {:.2} GB in {:.1} s", path.display(), len as f64 / 1e9, t.elapsed().as_secs_f64()); }