Adding remove file option to BSD tar?

Tim Kientzle kientzle at freebsd.org
Sun Aug 20 18:17:45 UTC 2006


>> What do people think about adding an equivalent to
>> gtars --remove-files?
> 
> Shouldn't be too tricky.  If you think you know
> how to implement it, send me the diffs.
> 
> Doing this "safely" is nearly impossible, of
> course.  In the compressed case, the compression
> pipeline buffers a LOT of data ...

Actually, this might not be as hard as I first thought.

Just keep a FIFO of files added to the archive, and
a running count of the total size of those files.
When the count exceeds some limit, delete the
oldest file in the queue and update the size.
If you keep the limit pretty high (2MB?  10MB?),
then you can be pretty confident that files
will not get deleted before they have been
safely added to the archive.

Tim Kientzle


More information about the freebsd-hackers mailing list