From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 2 06:35:11 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 0D7E216A4EA for ; Wed, 2 Aug 2006 06:35:11 +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 CE03043D55 for ; Wed, 2 Aug 2006 06:35:03 +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 k726Z3jU010788; Tue, 1 Aug 2006 23:35:03 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <44D04797.1040201@freebsd.org> Date: Tue, 01 Aug 2006 23:35:03 -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: rick-freebsd@kiwi-computer.com References: <44CE03D2.2050803@centtech.com> <17614.4005.407223.621637@bhuda.mired.org> <44CE199C.2020500@centtech.com> <17614.8289.134373.387558@bhuda.mired.org> <96b30c400607310847s1d2f845eo212b234d03f51e9a@mail.gmail.com> <17614.10982.499561.139268@bhuda.mired.org> <20060801072611.GA717@turion.vk2pj.dyndns.org> <20060801171150.GB3413@megan.kiwi-computer.com> <44CF8F1A.5090506@centtech.com> <20060801174048.GE3413@megan.kiwi-computer.com> In-Reply-To: <20060801174048.GE3413@megan.kiwi-computer.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] adding two new options to 'cp' 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: Wed, 02 Aug 2006 06:35:11 -0000 Rick C. Petty wrote: > > While we're at it, I think we should add the -S option to bsdtar. I'm > willing to do the work ... I have pretty strong ideas about sparse file support for bsdtar. The "cheap" solution is to handle it purely on extract: Detect blocks of zeros when restoring files and seek over them. That would be pretty easy to implement: just add another option to archive_read_extract() and implement the logic to skip over blocks of zeros. Archiving sparse files as such is harder, although I do have an outline of a technique which would not only handle sparse files, but also allow archiving files whose size is not known in advance (something the GNU tar approach doesn't support). I simply dislike the GNU tar approach, in part because it requires two passes over the file (the map of holes is required before the file is written). Again, if someone is really interested, let me know. Tim Kientzle