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, 12.02.2026, 02:45

You seem to be conflating some things here. Ctrl-Z is not even a character -- it is a (but not the only) keyboard method of entering ASCII code 26. ASCII code 26 IS the End-Of-File character _in ASCII_. If you're dealing with ASCII text (which you usually are at a DOS command prompt) it simply IS the EOF character. But if you're not dealing with plain/pure ASCII text, code 26 could mean anything. And even in an ASCII text editor (including the editor DOS uses at the command-line), ASCII code 26 may not really mean "End-Of-File" or "End-Of-Input" in the sense you seem to be implying.

For example, if you create a file using the COPY CON FileName method, the way you tell the CON device that you are done entering lines of text (CON uses a line editor, not a text editor) is by entering ASCII code 26 (using any method you want, including Ctrl-Z from the keyboard) and then must also enter an End-Of-Line (usually by hitting Enter on the keyboard, but there are other ways to do that also). The End-Of-Line is required to tell the line editor that you're done editing that line, and the EOF code 26 is simply one of the characters on that line. The text that was entered up to and including the EOF code 26 is stored in the file, but the final End-Of-Line (or any characters entered after the EOF code 26) are not stored in the file.

Technically, the DOS command-line and CON are not "DOS" (not part of the kernel), but to say they are not part of DOS is, at best, misleading and incomplete, sort of like saying bash is not unix. It may technically be correct, but is nowhere near enough of the story to figure out what's really going on.

 

Complete thread:

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