Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Ctrl-Z was never actually an EOF character in MS-DOS (Miscellaneous)

posted by bretjohn Homepage E-mail, Rio Rancho, NM, 14.02.2026, 02:34

Let me just say you can't necessarily trust Wikipedia. To claim that DOS essentially ignores (or at least sort of ignores) the EOF character (or what you're calling SUB which means it should be totally ignored as if it doesn't even exist) is simply not true.

For example, if you TYPE a file, DOS assumes the file is ASCII and only types until it finds an EOF (ASCII code 26). Anything after the EOF is ignored, no matter how big the file is. I take advantage of this in some of my programs. As part of the header at the beginning of the programs, I put an EOF character in the header so if somebody TYPEs one of my executable programs (e.g., "TYPE CLOCK.COM") they see a little blurb about the program and then the output stops. Most programs don't do this, and if you TYPE the executable program you usually see a bunch of funky characters and get a few beeps out of the speaker (the ASCII BEL character) before it finally (accidentally) reaches an ASCII code 26 and stops.

Similarly, when using the COPY command, the _default_ is to use binary mode when copying files between disks, but when using COPY to concatenate files, or when either of the two locations is a (character) device instead of a file (block device), the default is to assume ASCII and only copies only until the first EOF is found. This is particularly important when concatenating ASCII files using COPY, since if the last character of the file is an EOF, the EOF character is not copied to the concatenation and a single EOF is automatically added to the end of the concatenation. You can override the default settings of COPY with command-line switches (such as /B to force binary mode), but by default the EOF character matters VERY much to DOS (depending on the specific context).

You can only say DOS "doesn't care" about EOF if you think utilities like TYPE and COPY aren't part of DOS.

 

Complete thread:

Back to the forum
Board view  Mix view
23246 Postings in 2191 Threads, 405 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum