Skip to content

Commit 2253a40

Browse files
committed
fix: create extract_dir on same filesystem as out_dir
Otherwise, fs::rename will fail if extract_dir and out_dir are on different filesystems. Signed-off-by: Jim Crossley <jim@crossleys.org>
1 parent 7b8ba24 commit 2253a40

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

postgresql_archive/src/archive.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,7 @@ pub async fn extract(bytes: &Bytes, out_dir: &Path) -> Result<()> {
349349
return Ok(());
350350
}
351351

352-
let extract_dir = tempfile::tempdir()?.into_path();
353-
create_dir_all(&extract_dir)?;
354-
352+
let extract_dir = tempfile::tempdir_in(parent_dir)?.into_path();
355353
debug!("Extracting archive to {}", extract_dir.to_string_lossy());
356354

357355
for archive_entry in archive.entries()? {

0 commit comments

Comments
 (0)