Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!agate!darkstar!cats.ucsc.edu!jik From: jik@cats.ucsc.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: How to archive several files with tar? Message-ID: <17139@darkstar.ucsc.edu> Date: 17 Jun 91 21:20:10 GMT References: <626E0BEE3F3F601CC4@lure.latrobe.edu.au> <16873@darkstar.ucsc.edu> <2740@root44.co.uk> <16978@darkstar.ucsc.edu> <2742@root44.co.uk> Sender: usenet@darkstar.ucsc.edu Organization: University of California, Santa Cruz Lines: 42 In article <2742@root44.co.uk>, gwc@root.co.uk (Geoff Clare) writes: |> In article <2740@root44.co.uk>, I wrote: |> > 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. No, I got your main point. But you missed mine, which I guess makes us even. |> 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. A GOOD VERSION OF TAR will check the amount of bytes it has written, and stop when it has reached the number of bytes recorded in the header preceding the file. My point in my last two postings in this thread is that there are BAD VERSIONS OF TAR that don't do that. They stat the file, record its size in the tar file, and then open the file and read it until EOF and write its contents into the tar file. |> >I was talking about the "worst case," i.e. a poor version of tar. |> |> I claim categorically that such a tar is broken. Yes, of course it's broken. I never claimed otherwise. My point in my previous two postings, and in this one, is that SUCH BROKEN VERSIONS EXIST, and that, therefore, the worse thing that can happen to you if you try to add a tar archive to itself is that the file will grow until it can't grow any further. Got it? -- Jonathan Kamens jik@CATS.UCSC.EDU