Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!lll-winken!uunet!mcsun!ukc!pyrltd!root44!gwc From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.unix.questions Subject: Re: How to archive several files with tar? Message-ID: <2742@root44.co.uk> Date: 14 Jun 91 12:26:42 GMT References: <626E0BEE3F3F601CC4@lure.latrobe.edu.au> <16873@darkstar.ucsc.edu> <2740@root44.co.uk> <16978@darkstar.ucsc.edu> Organization: UniSoft Ltd., London, England Lines: 46 In article <2740@root44.co.uk>, I wrote: > Although many utilities will fill the disk if made to read their output > file, this is not true of tar (unless you have a broken tar). In the tar > output format the size of each file is contained in a header which > precedes the file's contents. Hence the amount of data which tar will > read from its own output file is limited to its size when tar starts > reading it. If the output file is the last input file, it will > approximately double in size when tar reads it. > > Any decent version of tar will warn you if an input file changes in size. In <16978@darkstar.ucsc.edu> jik@cats.ucsc.edu (Jonathan I. Kamens) writes: >I have *used* a version of tar which does not do proper version checking, and >which therefore creates a tar archive that fills the disk. I would not have >mentioned it if I hadn't used it. Jonathan has completely missed my main point and picked up on an aside. It is not "version checking" that stops tar from filling the disk, it is the fundamental fact that the tar output format contains each archived file's size before its contents. Once tar has written out the size of the file in a header block, it must write exactly that many bytes of data as the file's contents, even if the file changes size. Otherwise the output tar archive will be corrupt and unusable. My comment that "any decent version of tar will warn you if an input file changes in size" was an afterthought, intended to reassure people who deduced (correctly) that, since tar is forced to write the number of bytes it said it was going to write rather than the number of bytes it is able to read from the file, if a file changes in size the archived data may not correspond to either the old or the new version of the file, but something in between. >Now, perhaps my recollection is wrong, and I didn't actually ever use such a >tar. But unless you're willing to make the categorical claim that such a tar >does not exist (which you appear to be unwilling to do, since you said "unless >you have a broken tar" and later "Any decent version of tar"), saying that I >am "wrong" is unwarranted. >I was talking about the "worst case," i.e. a poor version of tar. I claim categorically that such a tar is broken. -- Geoff Clare (Dumb American mailers: ...!uunet!root.co.uk!gwc) UniSoft Limited, London, England. Tel: +44 71 729 3773 Fax: +44 71 729 3273