From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 1 17:40:50 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 8078F16A583 for ; Tue, 1 Aug 2006 17:40:50 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (megan.kiwi-computer.com [63.224.10.3]) by mx1.FreeBSD.org (Postfix) with SMTP id 9361843D49 for ; Tue, 1 Aug 2006 17:40:49 +0000 (GMT) (envelope-from rick@kiwi-computer.com) Received: (qmail 4178 invoked by uid 2001); 1 Aug 2006 17:40:48 -0000 Date: Tue, 1 Aug 2006 12:40:48 -0500 From: "Rick C. Petty" To: Eric Anderson Message-ID: <20060801174048.GE3413@megan.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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44CF8F1A.5090506@centtech.com> User-Agent: Mutt/1.4.2.1i 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 Reply-To: rick-freebsd@kiwi-computer.com 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 17:40:50 -0000 On Tue, Aug 01, 2006 at 12:27:54PM -0500, Eric Anderson wrote: > > Wouldn't this be incorrect for files that are really full of zeros? It > would turn them in to sparse files when they shouldn't be, correct? Is > that what happens with other tools? Why is this bad? I'm not suggesting that the default implementation should change but that this "-s" option be added to properly optimize for sparse files. A sparse file is one which contains blocks of pure zeros. My example wouldn't vary in how the destination file is read but in how many blocks are allocated in the underlying file system. One of my biggest gripes with cp(1) was how a recursive tree copy was always larger than the source, if the source contained any sparse files. This is similar to your desire to add "-l" for doing hard links. Both have their usefulness. And your "-a" option could be a replacement for "-pRs" if so desired (or "-S", it's all the same to me). While we're at it, I think we should add the -S option to bsdtar. I'm willing to do the work and make patches (to cp & tar), if someone is willing to review and commit them. -- Rick C. Petty