From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 20 18:17:45 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C2AF16A4DA for ; Sun, 20 Aug 2006 18:17:45 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6AD6343D49 for ; Sun, 20 Aug 2006 18:17:44 +0000 (GMT) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.221] (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id k7KIHhuV004108; Sun, 20 Aug 2006 11:17:43 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <44E8A747.2050807@freebsd.org> Date: Sun, 20 Aug 2006 11:17:43 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steven Hartland References: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> <44D94C69.1030901@freebsd.org> In-Reply-To: <44D94C69.1030901@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Adding remove file option to BSD tar? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Aug 2006 18:17:45 -0000 >> 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