bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Appending from non-seekable input like /dev/stdin silently fails


From: Boris Gjenero
Subject: Appending from non-seekable input like /dev/stdin silently fails
Date: Thu, 3 Nov 2022 00:16:55 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1

Hi,

I thought I could create a tar archive on the local computer, and pipe it via ssh to append to a remote archive. This did not work. It seems that with GNU tar 1.34, appending to a tar archive from /dev/stdin or similar non-seekable input like bash process substitution does not work.

Here is an example. First, create some trivial archives:

$ echo Hello\ World > foo
$ tar cf foo.tar foo
$ cp foo.tar bar.tar

Now, let's try appending from /dev/stdin:

$ md5sum foo.tar
052b2b73a89f5ea4f587adc82a2ba87e  foo.tar
$ cat bar.tar | tar -Af foo.tar /dev/stdin
$ tar tvvf foo.tar
-rw-r--r-- pi/pi            12 2022-11-02 23:56 foo
$ md5sum foo.tar
052b2b73a89f5ea4f587adc82a2ba87e  foo.tar

That didn't change the archive at all, but there was no error message saying that something went wrong. I think that's a bug. Now do a proper append, to show how it should work:

$ tar Af foo.tar bar.tar
$ tar tvvf foo.tar
-rw-r--r-- pi/pi            12 2022-11-02 23:56 foo
-rw-r--r-- pi/pi            12 2022-11-02 23:56 foo

This was the expected result.

Thanks,
Boris



reply via email to

[Prev in Thread] Current Thread [Next in Thread]