3 ms·
"Close file" will update the directory entry for the current extent. It doesn't (AFAIK) delete other extents or free any blocks that have been allocated to the
by rep_lodsb 2y ago
"Close file" will update the directory entry for the current extent. It doesn't (AFAIK) delete other extents or free any blocks that have been allocated to the file.
The "last record" field of the FCB / direntry will be decremented for each line, so that the shell can keep track of where in the file it should continue (this can't be stored in memory, because programs are explicitly allowed to overwrite the command processor). But the space on disk won't be freed until it's done executing all commands in the file.
For an emulator it makes sense to actually truncate the file, because on other systems there is likely no way to store a "logical" file size that is shorter than the actual one.