Date: Tue, 01 Aug 2006 23:30:26 +0200 From: Joerg Sonnenberger <joerg@britannica.bec.de> To: freebsd-hackers@freebsd.org Subject: Re: [PATCH] adding two new options to 'cp' Message-ID: <20060801213026.GA26016@britannica.bec.de> In-Reply-To: <20060801190453.GD717@turion.vk2pj.dyndns.org> References: <17614.8289.134373.387558@bhuda.mired.org> <96b30c400607310847s1d2f845eo212b234d03f51e9a@mail.gmail.com> <17614.10982.499561.139268@bhuda.mired.org> <ealpn1$lan$1@sea.gmane.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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060801213026.GA26016>