So here strategy should try to place the shortest file of this set of long files.
If all files are bigger than the gap, then the program will try to enlarge the gap by moving the file away that is at the end of the gap. Since this file is bigger than the gap, the new size of the gap will be bigger than the shortest file above the gap. It can happen only once.
I think the worm can only happen when there are 2 or more small files directly above the gap, and 1 or more huge files further along.
Not a combination.
My 1-line description of the 100-line algorithm leaves out some special cases. For example, the gap-filling algorithm will also finds single files that exactly fill the gap. It does not only find combinations of files.
if you want to fill some gap with files - you analyze only files-candidates till next gap, or all files above current gap(till disk end). in current defragmenter implementation?
All files above the gap (till disk end).