bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Solution to updating compressed archives: Pre-compress fil


From: Joerg Schilling
Subject: Re: [Bug-tar] Solution to updating compressed archives: Pre-compress files
Date: Mon, 31 Oct 2011 10:47:38 +0100
User-agent: nail 11.22 3/20/05

Carl Eklof <address@hidden> wrote:

> Hello Joerg,
>
> Why would you need to read the file twice?
>
>
> Maybe I should have prefaced my feature requests with a note that I have not 
> looked into the packed structure of a tar file. 
>
> I could see that, if the header placed at the beginning contained the length 
> of the file contents inside of the tar-file. Is that the case? Our hack uses 
> a delimiter (that needs is escaped if it appears in the content), so I never 
> even considered need
>

If you did implement related code, you should know that you need to know both 
the uncompressed and the compressed size of the file before starting to archive 
it.

These numbers could be retrieved by compressing to /tmp and then archiving the 
intermediate file if it did not overflow that volume or by archiving the file 
first to get the size and then another time to archive it.

As mentioned before, you cannot predict the compressed size of a file, so you 
don't know whether it will overflow /tmp.

Jörg

-- 
 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden                (uni)  
       address@hidden (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



reply via email to

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