From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 1 21:30:53 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 9D90E16A4DD for ; Tue, 1 Aug 2006 21:30:53 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from antivirus.uni-rostock.de (mailrelay1.uni-rostock.de [139.30.8.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id C239A43D45 for ; Tue, 1 Aug 2006 21:30:51 +0000 (GMT) (envelope-from joerg@britannica.bec.de) Received: from antivirus.exch.rz.uni-rostock.de ([127.0.0.1]) by antivirus.uni-rostock.de with Microsoft SMTPSVC(6.0.3790.1830); Tue, 1 Aug 2006 23:30:50 +0200 Received: from antivirus.uni-rostock.de (unverified) by antivirus.exch.rz.uni-rostock.de (Content Technologies SMTPRS 4.3.20) with ESMTP id for ; Tue, 1 Aug 2006 23:30:50 +0200 Received: from mail pickup service by antivirus.uni-rostock.de with Microsoft SMTPSVC; Tue, 1 Aug 2006 23:30:49 +0200 X-SCL: 5 70.15% Received: from mail.uni-rostock.de ([139.30.8.11]) by antivirus.uni-rostock.de with Microsoft SMTPSVC (6.0.3790.1830); Tue, 1 Aug 2006 23:30:49 +0200 Received: from conversion-daemon.mail2.uni-rostock.de by mail2.uni-rostock.de (iPlanet Messaging Server 5.2 HotFix 2.09 (built Nov 18 2005)) id <0J3C00B018TZN6@mail.uni-rostock.de> (original mail from joerg@britannica.bec.de) for freebsd-hackers@freebsd.org; Tue, 01 Aug 2006 23:30:49 +0200 (MEST) Received: from britannica.bec.de (storm.stura.uni-rostock.de [139.30.252.72]) by mail2.uni-rostock.de (iPlanet Messaging Server 5.2 HotFix 2.09 (built Nov 18 2005)) with ESMTP id <0J3C002UV93DY8@mail.uni-rostock.de> for freebsd-hackers@freebsd.org; Tue, 01 Aug 2006 23:30:49 +0200 (MEST) Received: by britannica.bec.de (Postfix, from userid 1000) id 2504A63D7; Tue, 01 Aug 2006 23:30:26 +0200 (CEST) Date: Tue, 01 Aug 2006 23:30:26 +0200 From: Joerg Sonnenberger In-reply-to: <20060801190453.GD717@turion.vk2pj.dyndns.org> To: freebsd-hackers@freebsd.org Mail-followup-to: freebsd-hackers@freebsd.org Message-id: <20060801213026.GA26016@britannica.bec.de> MIME-version: 1.0 Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: Mutt/1.5.12-2006-07-14 References: <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> <44CF94A4.3000306@centtech.com> <20060801190453.GD717@turion.vk2pj.dyndns.org> X-OriginalArrivalTime: 01 Aug 2006 21:30:49.0407 (UTC) FILETIME=[C1EDE4F0:01C6B5B1] 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:30:53 -0000 On Wed, Aug 02, 2006 at 05:04:53AM +1000, Peter Jeremy wrote: > On Tue, 2006-Aug-01 12:51:32 -0500, Eric Anderson wrote: > >string of zeros larger than the block size, or it needs to 'do the right > >thing' and determine if it's sparse or not. > > You can do this by comparing stat.st_size with stat.st_blocks - a > sparse file will have fewer blocks than its size requires. What you > can't do is accurately determine where the holes are. There's an extension for the seek interface in Solaris to do that. Joerg Schily discussed this with some of us BSD developers in Chemnitz/Germany earlier this year. There was someone working on porting it to FreeBSD IIRC. Joerg