[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: the description of -A / --concatenate is inconsistent
From: |
Sergey Poznyakoff |
Subject: |
Re: the description of -A / --concatenate is inconsistent |
Date: |
Mon, 01 May 2023 19:25:26 +0200 |
User-agent: |
MH (GNU Mailutils 3.15) |
Hi Benno,
> But when I try to do something like:
>
> tar -A -f 11.tar 22.tar 33.tar
>
> only 22.tar is appended to 11.tar, and 33.tar is silently ignored.
As a matter of fact, both are appended. You can easily confirm that if
you used the -i option when testing the resulting archive, like that:
tar -t -i -f 11.tar
The problem here is that the append operation concatenates all files
listed in the command line verbatim, including their terminating zero
blocks. Before appending, however, tar seeks in the target archive (the
one given with the -f option) to the offset right before its terminating
zero blocks. As a result, first file is concatenated to the target
archive without two zero blocks in between, whereas the remaining files
are appended preserving zero blocks at the end of each of them (assuming
they are valid tar archives). When testing or extracting the archive,
operation stops when first two zero blocks are encountered. Hence the
need for the -i (--ignore-zeros) option when reading such archives.
That being said, I agree that this mode of operation is confusing and
had better be fixed.
Regards,
Sergey