bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Adding non-materialized files from a stream


From: Tim Kientzle
Subject: Re: [Bug-tar] Adding non-materialized files from a stream
Date: Thu, 16 Oct 2008 17:11:15 -0700
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422

Ryan Jud Hughes wrote:

Write a header block and leave spaces for file size and checksum. Leave these as some constant value that indicates that they are placeholders. Then start writing the data, keeping track of the size of the file as we go. Once we've written all of it, seek back to the header block and fill in the size, and finally compute the checksum.

This would certainly work for your situation.
The basic ustar archive format is pretty simple
and it shouldn't be hard to write code
from scratch to do this.

None of the standard tar implementations work
this way, however, because it's impossible to
seek on tape drives or within compressed streams.
Basically, if you want to use tar, you'll need
to either figure out the data size in advance
or write your own code.  I suspect you'll find
storing the data into a temporary file to be
the simpler solution.  ;-)

You might also look into Zip libraries or tools.
The Zip format has some extensions that are
specially designed to support exactly this style
of usage.

Cheers,

Tim Kientzle




reply via email to

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