> touch 1
> tar cz 1 > file.tgz
> ls -al file.tgz
-rw-rw-r-- 1 martinea martinea 10240 Nov 23 07:32 file.tgz
> dd if=file.tgz count=1 bs=108 > a.tgz
> gunzip -t -v a.tgz
a.tgz:   OK

Why the file is 10k in size? Why tar pad with zeros a compressed output?
The first 108 bytes are the compressed tar file followed by zeros.

> tar c 1 | gzip > file.tgz
> ls -al file.tgz
-rw-rw-r-- 1 martinea martinea 108 Nov 23 07:45 file.tgz

Only 108 bytes.

Jean-Louis



Tim Kientzle wrote:
Sergey Poznyakoff wrote:
Vitaly V. Ch <[EMAIL PROTECTED]> ha escrit:

On some machines run under slackware 10.2 next test always fail:

for ((i=0;i<1000;i++)); do echo $i >$i; tar cz $i >>file.tgz; done;
gzip -t -v file.tgz

It should have failed. You cannot glue together two compressed files and
expect the result to be a valid compressed file.

That doesn't quite explain why his second example always
works for him, though:

but following test always success on all machines:

 for ((i=0;i<1000;i++)); do echo $i >$i; tar c $i | gzip >>file.tgz;
done; gzip -t -v file.tgz

It does sound as though tar is exiting before the child
gzip under some circumstances.

Tim Kientzle










Reply via email to