FIle and Block size relationships ...

Ben Duncan bns
Tue Jun 6 16:05:50 PDT 2006


Ok, I am busily writing my MVISAM package, when I noticed in some intense reading
about the lINUX file system - file size / block size on files.

I created a file with exactly 512 BYTES (It is my FILE header FWIW).
I did a stat on it and it shows:

bend at bns:mvisam -> stat test.dat
   File: `test.dat'
   Size: 512             Blocks: 8          IO Block: 4096   regular file
Device: 821h/2081d      Inode: 71290       Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (  500/    bend)   Gid: (  500/  appgen)
Access: 2006-06-06 10:20:15.000000000 -0500
Modify: 2006-06-06 08:46:23.000000000 -0500
Change: 2006-06-06 08:46:23.000000000 -0500

Does this mean that my FILE is really using 4096 BYTES of space
and if I go over 4096 bytes, each "extension" will cost me
4096 byes (i.e 4100 byes file will really occupy 8192 bytes) ?

I need to know, so I can tune my buffer/cache routines ..
Or, if anyone has any suggestion on block size / cache
I would appreciate it ...

Thanks ..

-- 
Ben Duncan   - Business Network Solutions, Inc. 336 Elton Road  Jackson MS, 39212
"Never attribute to malice, that which can be adequately explained by stupidity"
        - Hanlon's Razor



More information about the Linux-users mailing list