Possible Duplicate:
Internal Fragmentation
I have recently been working on a project to recursively list all files within a directory and output the filename, size and path.
I now need to add the amount of internal fragmentation to the output and then work out the percentage of internal fragmentation within the directory.
I have worked out to do this. I need the inode number (which I get from stat()
). I then need to follow that inode number and traverse through the inodes to find the last block. I then need to work out how much unused space there is in this block and that will give me the internal fragmentation.
In desperate need of help before I tear out my hair!