ouch icon indicating copy to clipboard operation
ouch copied to clipboard

Ouch fails when crossing filesystem boundaries

Open marcospb19 opened this issue 5 months ago • 1 comments

Version

0.6.1

Description

Ouch uses fs::rename (equivalent to mv) to perform atomic decompression, and "smart unpack" (flattening of decompressed archives when the the top-level directory is another directory, requiring you to cd twice before you see any content).

However, that doesn't work when the renamed file paths are in two different file paths, as that wouldn't be cheap.

Ouch should fallback to copying, or, if possible, find a solution that doesn't require having 2 entire copies of a huge file in disk at the same time (is there a way to avoid that??)

Current Behavior

When decompressing, fails when --dir directory lives in another FS, or, when merging contents into a directory that does so.

Expected Behavior

Shouldn't fail, even if it means we'll take some compromises.

Additional Information

No response

marcospb19 avatar Jul 26 '25 22:07 marcospb19

It's likely not a problem to have two entire copies of the same file if they are in two filesystems and they are both disk-based.

As disk-based filesystems have pre-allocated sectors (regions) that don't overlap.

Sounds worse if the two are memory-based filesystems, but how likely is that.

marcospb19 avatar Jul 26 '25 22:07 marcospb19