Carl Eklof <[email protected]> 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:[email protected] (home) Jörg Schilling D-13353 Berlin
       [email protected]                (uni)  
       [email protected] (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily

Reply via email to