What I want to ask about is this second type of fragmentation I've came up with. Lets suppose we install a program. This program has very many files. When the program starts, the program always loads the contents of those files sequentially. Now, even if the hard disk is defragmented, there is still a possibility that the files (but not the blocks building up to files) will be scattered on the disk and thus the program launch time will be longer
It’s not a novel definition. Back tn the days of DOS, defragmenters (including the one that comes with DOS) actually would defragment directories in that way in addition to individual files. Even in the days of Windows, program like Norton SpeedDisk would strive to make sure that the files in a directory are stored contiguously. In fact, you can even watch it happen with the defragmenter that comes with Windows 9x: it moves data to the end of the disk to free up space to move other files back.
is the type of fragmentation I mentioned relevant for the file system?
NTFS has all but supplanted FAT* as the primary OS on Windows. On the one hand, it suffers from higher directory fragmentation which hurts it here, but on the other, it has a more efficient indexing which allows for faster seek to files. As a result, the file-system tends not to play too big a role in this matter.
What does play a big role is that drives have gotten much faster than in the past. In fact, SSDs make it completely irrelevant.
is it possible to remedy this kind of fragmentation
The problem is that since those heady DOS days, the size of disks has gotten much larger which makes defragmenting directories next to impossible because everything after it must be moved to make room. So with larger disks, moving massive amounts of data back and forth can be extremely cumbersome to the point that it is easier just to wait the extra second to launch a program than wait 20 hours to defragment like that.
(To be honest, I still don’t understand why FAT* directories cannot be defragmented like any other file. It’s certainly easy enough to do it manually, so I don’t know why a program cannot automate it. Maybe I’ll write a defragmenter one day…)
if yes, how would you do it?
These days, seek times are low enough that this level of fragmentation is not generally going to be too noticeable in practice unless a program has thousands of tiny files spread all of the disk *cough*winsxs*cough*.
(For the record, this would be a poor design. Games are the software that need the most performance, and they usually pack their innumerable small files into one large one that can be indexed, so applications have no excuse to litter the drive with more tiny, sub-cluster–sized files than there are stars in the sky.)
When this sort of scenario occurs, it is in effect, no different than a big file being heavily fragmented and would likely impact load time for a bit until the various caches throughout the system take effect. As kinokijuf mentioned, the Windows prefetcher attempts to help increase cache performance by learning what needs to be cached (in XP, make sure that the Task Scheduler service is enabled and running or else the prefetcher won’t work!)
There are various tools that purport to analyse your usage and optimize files to speed things up. Their efficacy is debatable (and for some reason usually subjective). If a program is affected by this, you can try using a defragmenter that specifically includes a move-files-around-to-increase-access-speed function, but they usually just move them to the end of the partition which if anything, actually slows down access by having them closer to the hub where disk throughput is lower than near the edge! You would be better off just contacting the developer and filing a bug report/feature request.