From 2285995f3338e5992e305afcf0d7988f17274706 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Fri, 2 Aug 2024 13:02:56 -0500 Subject: [PATCH] create more hff directories to avoid not moving them if the moves failed and just printed a warning, the pts directory could stay around and cause problems for future runs --- src/coord_type/normal.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/coord_type/normal.rs b/src/coord_type/normal.rs index a102dfb..10fae81 100644 --- a/src/coord_type/normal.rs +++ b/src/coord_type/normal.rs @@ -328,7 +328,14 @@ impl Normal { /// to dir/hff/{opt,pts,freqs} fn cleanup(dir: impl AsRef) { let dir = dir.as_ref(); - let hff = dir.join("hff"); + let mut hff = dir.join("hff"); + + let mut i = 0; + while hff.exists() { + log::trace!("hff dir found, incrementing counter"); + hff = dir.join(format!("hff{i}")); + i += 1; + } if let Err(e) = std::fs::create_dir_all(&hff) { log::warn!("failed to create {hff:?} with {e}");