From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 1 18:26:42 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 B8B2016A4DA for ; Tue, 1 Aug 2006 18:26:42 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (vpn.mired.org [66.92.153.74]) by mx1.FreeBSD.org (Postfix) with SMTP id 2022143D98 for ; Tue, 1 Aug 2006 18:26:30 +0000 (GMT) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 96093 invoked by uid 1001); 1 Aug 2006 18:26:29 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Tue, 01 Aug 2006 14:26:29 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17615.40148.872008.53973@bhuda.mired.org> Date: Tue, 1 Aug 2006 14:26:28 -0400 To: rick-freebsd@kiwi-computer.com In-Reply-To: <20060801171150.GB3413@megan.kiwi-computer.com> References: <200607271150.k6RBoM9p031745@lurza.secnetix.de> <44C8FB65.9020102@FreeBSD.org> <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> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer 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: Tue, 01 Aug 2006 18:26:42 -0000 In <20060801171150.GB3413@megan.kiwi-computer.com>, Rick C. Petty typed: > On Tue, Aug 01, 2006 at 05:26:11PM +1000, Peter Jeremy wrote: > > On Mon, 2006-Jul-31 22:42:49 +0200, Ivan Voras wrote: > > >I agree with this, and while you're in there, can you add -s to copy > > >sparse files (via the usual "if the buffer is all nulls, seek beyond eof > > >instead of writing" trick)? > > > > Note that it isn's possible to accurately distinguish between a block > > of NULs and a hole in the file through the filesystem. The only way > > to accurately copy a sparse file is with dump/restore. > > Sure it is-- in a number of ways. The most useful way is to do something > of the sort: [code elided] > Obviously, I didn't add the error checking/handling, but AFAIK this is > essentially what the -S option to gnu's tar does. Yes, but gnu tar doesn't do this accurately, so you're not doing what Peter said you couldn't do. You are doing what Ivan asked, though. I always think of cp as a tool for making *copies of files*, not for creating an archive of a directory tree. We've got lots of tools that do the latter. Do we really need another one? http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.