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

Attachment: pgpamKbTi5BUJ.pgp
Description: PGP signature

Reply via email to