I'm trying to understand how defragmenting works so I can write my own program to do it. I was considering have it iterate through the files on the hard drive and defragment them each seperately. However, I came across a FAQ on a website for FragExt that states this:
Should I use FragExt to defragment all the files on my hard drive?
You can, but I don't advise that you do. A good volume defragmenter gives special consideration to usage relationships between different files, arranging them together and placing them at specific locations on the hard disk. Currently, FragExt simply looks for the first amount of free space large enough to defragment the file into and uses it. Future versions may include support for optimal placement patterns.
I'm wondering the reason behind this? And what exact "special consideration" should be given to determine where the cluster should be moved to?