From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 1 21:49:06 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 7030D16A4FA for ; Tue, 1 Aug 2006 21:49:06 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C784143E5C for ; Tue, 1 Aug 2006 21:47:10 +0000 (GMT) (envelope-from freebsd-hackers@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1G823p-000120-AJ for freebsd-hackers@freebsd.org; Tue, 01 Aug 2006 23:45:57 +0200 Received: from cmung1752.cmu.carnet.hr ([193.198.134.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Aug 2006 23:45:57 +0200 Received: from ivoras by cmung1752.cmu.carnet.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Aug 2006 23:45:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Tue, 01 Aug 2006 23:44:51 +0200 Lines: 45 Message-ID: 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> <17615.40148.872008.53973@bhuda.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cmung1752.cmu.carnet.hr User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) In-Reply-To: <17615.40148.872008.53973@bhuda.mired.org> Sender: news 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 21:49:06 -0000 Mike Meyer wrote: > 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? But, but, but - I only asked for cp to be able to copy my sparse files as sparse files, not do magic with them :) The side-effect that it will sparsify other files is both unavoidable and actually useful. OTOH, for copying/sparisfying single files, dd should be fixed. vsdev:/tmp> l total 2 drwx------ 2 ivoras wheel 512 Jul 9 00:08 mc-ivoras/ vsdev:/tmp> dd if=/dev/zero of=file bs=1024 seek=100 count=1 1+0 records in 1+0 records out 1024 bytes transferred in 0.016648 secs (61509 bytes/sec) vsdev:/tmp> l total 8 -rw-r--r-- 1 ivoras wheel 103424 Aug 1 21:40 file drwx------ 2 ivoras wheel 512 Jul 9 00:08 mc-ivoras/ vsdev:/tmp> du -shc file 6.0K file 6.0K total vsdev:/tmp> l total 8 -rw-r--r-- 1 ivoras wheel 103424 Aug 1 21:40 file drwx------ 2 ivoras wheel 512 Jul 9 00:08 mc-ivoras/ vsdev:/tmp> dd if=file of=file2 bs=1024 conv=sparse 101+0 records in 101+0 records out 103424 bytes transferred in 0.130216 secs (794250 bytes/sec) vsdev:/tmp> l total 110 -rw-r--r-- 1 ivoras wheel 103424 Aug 1 21:40 file -rw-r--r-- 1 ivoras wheel 103424 Aug 1 21:41 file2 drwx------ 2 ivoras wheel 512 Jul 9 00:08 mc-ivoras/ vsdev:/tmp> du -shc file* 6.0K file 102K file2 108K total