[PATCH] adding two new options to 'cp'

Peter Jeremy peterjeremy at optushome.com.au
Tue Aug 1 19:05:17 UTC 2006

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.

Note that st_blksize is not nessarily the allocation blocksize and
therefore is unrelated to the size of holes in the filesystem.  Also,
on FreeBSD, the designation of "optimal" is a misnomer and I/O
operations should be much larger than this for optimal efficiency.

Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060801/aabbeb3d/attachment.pgp

More information about the freebsd-hackers mailing list