[comp.os.minix] tar. Was Re: Library glitches

klamer@mi.eltn.utwente.nl (Klamer Schutte) (06/03/91)

In <1991Jun1.091604.8465@crash.cts.com> cwr@pnet01.cts.com (Will Rose) writes:

>There was also something strange about the tar file of that posting -
>the files unpacked totalled ~25K, while the archive itself was ~40K
>(from memory).  I had another archive recently that showed a similare
>effect, tho' not so marked.  Is this a 'feature' of minix tar?  I don't
>think all tars have that sort of overhead.

I don't know about the tar file -- but do know the (minix) tar behaviour.
In general will a tar file which consist of small files and/or with
very much directories give a big overhead. This because of:
1) Each file has a 512 bytes header.
2) Each file will be (zero) padded to a 512 bytes boundary
3) Minix tar (each POSIX compliant one) will for every directory also
   include a 512 byte header. Older tar (e.g. the SunOs one) do not do
   this.
4) Tar terminates the tar file with an empty 512 bytes block.

For the file aap/noot/mies/wim, length 2 bytes this will give:
aap, noot, mies : directory == 3 * 512 = 1536 bytes
wim : file == 1 * 512 + ((2+511)/512) * 512 = 1024 bytes
trailer: 512 bytes.

Total length will thus be 3k, with only 2 bytes of data. This is quite an 
overhead. Traditinal tar's (minix-tar before 1.5) will give only 1.5k.

Klamer

PS But remember that all those blocks with zeros can be compressed very
   effective. tar+compress is about as efficient as shar+compress.
-- 
Klamer Schutte			Tel: +31-53-892786	Fax: +31-53-340045
Faculty of electrical engineering -- University of Twente, The Netherlands
preferred: klamer@mi.eltn.utwente.nl   SMTP: klamer@utelmi01.el.utwente.nl