Skip to content

Commit

Permalink
Fix - remove clerr reports during deduplication in same directory (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetVishnya authored Mar 21, 2023
1 parent 0944421 commit 585d504
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion casr/src/bin/casr-cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,19 @@ fn deduplication(indir: &Path, outdir: Option<PathBuf>, jobs: usize) -> Result<(
}

if !badrepidxs.is_empty() {
let clerr = outdir.unwrap_or_else(|| indir.to_path_buf()).join("clerr");
let clerr = outdir
.clone()
.unwrap_or_else(|| indir.to_path_buf())
.join("clerr");
fs::create_dir_all(&clerr)?;
for &index in badrepidxs.iter() {
fs::copy(
&paths[index],
clerr.join(paths[index].file_name().unwrap().to_str().unwrap()),
)?;
if outdir.is_none() {
fs::remove_file(&paths[index])?;
}
}
}

Expand Down

0 comments on commit 585d504

Please sign in to comment.