bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Detecting compressed archives from stdin


From: Eric Blake
Subject: Re: [Bug-tar] Detecting compressed archives from stdin
Date: Sat, 02 Feb 2008 07:40:06 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Michael B. Trausch on 2/1/2008 3:40 PM:
| However, if the archive is stored on disk and specified on the
| command-line, it works without this error message.  Obviously it can
| detect the format when the data is piped in; shouldn't there be a way to
| decompress while untarring?

Thanks for the report.  However, you're forgetting a crucial difference
between files and pipes.  With files, data is seekable, so tar merely
rewinds the file pointer back to the beginning before handing it to the
child decompression process.  But when piping data in, the data is not
seekable - once tar has read it, you cannot recover it by merely handing
the same stdin pipe to a child process.  It is technically possible to
create a filter thread or process, whose job it is to create a new output
pipe, replay the first few bytes that tar already read in determining that
stdin was compressed, then read the remainder of the original input pipe
and play it out to the child process, but no one has submitted the code to
do that yet.  Therefore, the best tar can do right now is tell you that it
can't untar the file because it can't hand all the essential data to the
child decompression program.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHpIDG84KuGfSFAYARAvCsAKCSYxnyTSZN4HnqUdhAfhOiCmN8WwCePxB9
k9SdgbcrlIHb8OmFLOw/bH8=
=crZJ
-----END PGP SIGNATURE-----




reply via email to

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