Programmer's type of Editor for DOS

Charles Hallenbeck hallenbeck at valstar.net
Sat Feb 16 08:52:41 EST 2002


Yes and no.

The use of ^Z for "end of file" in DOS is ambiguous. If it
appears in a text file, that is what it means; but it is not
necessary.

Before DOS there was CP/M in which "file size" was the number of
disk sectors required to store a file. CP/M did not know the
number of bytes in the file, only the number of disk sectors.
Therefore it had to know how much of the last sector was data and
how much of it was junk. That was why it used the "end of file
character" ^Z to divide that last sector into data and junk.

When DOS was introduced as a hybrid between CP/M and Unix, it had
to recognize the CP/M end of file traditions, although since it
now could store the true number of bytes in a file, it had no
real need for a special end of file character.

Many DOS editors allow the user to configure the software to add
a ^Z or not, according to user preferences.  It is best not to,
but often the default is to add one. It does no harm in DOS and
permits one to retrograde to CP/M, but of course it raises hell
when you move forward to Unix/Linux environments.

Chuck

On Sat, 16 Feb 2002, Kirk Wood wrote:

> Actually, if memory recalls correctly in the DOS world, control-z is the
> designated end of file character. I don't think a text file is ever
> created in dos without it.
>
> =======
> Kirk Wood
> Cpt.Kirk at 1tree.net
>
> Nowlan's Theory:
>         He who hesitates is not only lost, but several miles from
>         the next freeway exit.
>
>
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>

Visit me now at http://www.valstar.net/~hallenbeck
The Moon is Waxing Crescent (15% of Full)





More information about the Speakup mailing list