Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!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: <2740@root44.co.uk> Date: 12 Jun 91 12:58:17 GMT References: <626E0BEE3F3F601CC4@lure.latrobe.edu.au> <16873@darkstar.ucsc.edu> Organization: UniSoft Ltd., London, England Lines: 29 In <16873@darkstar.ucsc.edu> jik@cats.ucsc.edu (Jonathan I. Kamens) writes: >In article , adrianho@barkley.berkeley.edu (Adrian J Ho) writes: >|> The idea is _not_ to put the tar file in the directory you're tar'ing, >|> because your tar file will otherwise end up being included in itself. >|> In the worst case, it could be the _last_ file included, which means >|> that your tar file could end up being _twice_ as large as it's >|> supposed to be. > Actually, the worst case is that the tar file will continue to grow as tar >writes into it, so that when tar opens that file to archive it, the file will >grow as tar is archiving it, which means that there will be more to archive, >etc., etc. until the disk fills up or the user exceeds his quota or the >maximum file size or whatever. Actually, Jonathan is wrong and Adrian was right. 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. -- Geoff Clare (Dumb American mailers: ...!uunet!root.co.uk!gwc) UniSoft Limited, London, England. Tel: +44 71 729 3773 Fax: +44 71 729 3273