On 23/04/2006, at 8:31 PM, Malcolm V wrote:

I'm writing a program to calculate space lost to the difference between block size and filesize (Surely this has been done before, but I couldn't find it
from a quick few googles).

Whilst doing this, I've encountered the below and I'm unsure why it is
happening to some files only.

On an ext3 filesystem some files stat as being one disk block size larger
then would seem necessary.

This is because one block is used to store an "indirect block", containing pointers to other blocks. See for example

  http://www.tldp.org/HOWTO/Ext2fs-Undeletion-10.html

or any book about unix filesystems.

I expect you will find this happens on all files over 12 blocks in length.

--
Martin



--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to