Mail Archives: djgpp/1998/07/05/15:15:22
>Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
>>On 2 Jul 1998, Gili wrote:
>> Call me silly, but aren't editors suppose to stop reading in
>> textfiles at the EOF character? Isn't that the specification of some
>> standard?
>No, it's not a standard. It's a left-over from the ancient days of the
>CP/M operating system (which predates DOS). Somebody wanted to avoid
>accessing the file's directory entry (to know its size) when reading it.
It was (is?) a standard in the CP/M world. CP/M keeps the file
size as the number of 128 byte sectors that the file occupies,
there isn't an exact byte count. The EOF character (CTRL-Z) is
the only way a text file can be 'ended' at an arbitrary point.
This convention was adopted in MS-DOS since many programs
available for MS-DOS in its first few years were just ports of
the CP/M versions.
There are many other vestigial remains of CP/M in DOS, the "E5"
character used to mark empty directory entries, (the pattern left
in a disk after factory testing, by IBM?), the "program segment
prefix" (a copy of the first 256 bytes of memory in CP/M, were
the OS vectors and default FCBs are located,) the ".COM"
file format, file control blocks and FCB related OS functions,
reloading the command interpreter in high memory after letting
programs overwrite part of it to gain a little extra memory, etc.
RW.
- Raw text -