title: STAT Block size/blocks used
body: <p>I have a question which is confusing me and my task is to work out fragmentation.</p>
  
  <pre><code>stat() for a file:
  st_size = 10520
  st_blksize = 4096
  st_blocks = 24
  </code></pre>
  
  <p>I have read in some places that st_blksize is the general block size of the file system which in this case is <code>4096</code> but that file would fit into <code>3 blocks</code>, <code>10520 / 512</code> is <code>20.5</code> meaning that there are <code>3.5 blocks</code> of unused space, even though it is allocated. Does this mean that there are <code>1792</code> unused bytes in this file (fragmentation)?</p>
  
  <p>As I have mentioned I read into this a fair bit and have read a lot of contradicting texts, would like someone to clear this up once and for all!</p>