bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Fwd: bug in GnuTar


From: Vitaly V. Ch
Subject: Re: [Bug-tar] Fwd: bug in GnuTar
Date: Fri, 23 Nov 2007 14:54:26 +0200

possible another bug in tar/gzip interaction

On Nov 23, 2007 2:45 PM, Jean-Louis Martineau <address@hidden> wrote:
>
>  > 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 <address@hidden> 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

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