Files
borg/docs/internals
Thomas WaldmannandClaude Fable 5.1 1b7ff2b768 extract: refuse to extract into a non-empty directory, fixes #10057
Extracting into a non-empty directory replaces existing files that are in
the way and leaves all other existing files as they are, so the result is a
mix of existing and extracted files. Accidentally running "borg extract" in
a directory that is in use (like a home directory) thus replaced current
files by their archived state and blended the archive into the directory.

Now borg aborts with Archive.ExtractionDirNotEmpty (rc 33) before writing
anything if the current directory is not empty, unless --continue is given.
This also applies when only a part of the archive is extracted. --dry-run
and --stdout do not write into the directory, so they are not checked.

No new option: --continue already is the way to extract into a directory
that has contents. Its help and the extract docs now describe what it does
(skip files that are fully extracted already, replace other existing files)
and that a damaged file with unchanged size and mtime must be removed
before it can be extracted again.

Tests that extracted repeatedly into the same directory now use --continue
or a fresh directory.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-19 14:30:09 +02:00
..
2026-06-16 15:51:00 +02:00
2026-06-16 15:51:00 +02:00