• Please review our updated Terms and Rules here

CP/M 2.1?

It's ensuring that DCNT (the directory counter) is reset to 0 when an extent of a file is closed. When this happens, CLOSE is supposed to save any changes in the FCB to the directory, and then locate the FCB for the next extent if there is one. By not resetting DCNT, it means it doesn't search the whole directory and therefore may not locate the next extent of the file.
 
As in the case where the extent you just closed is located at the end of the directory space, and you need to perform a search of the directory space to locate the next available entry, which in this example, precedes the location of the formerly closed extent?

I can see how that wouldn't show up until the disk is sufficiently fragmented through repeated opens and closes with a lot of file system changes so that entries appear throughout the entire directory space rather than mostly at the start.

Did I understand that correctly?

Thank you for the explanation.
 
I haven't tried to replicate the scenario, so I don't know exactly what triggers it -- whether it's the fragmentation of one particular file, or operations on more than one file at a time (as might be seen when copying a file, for example).
 
Back
Top