|Date:||October 22, 2003 / year-entry #105|
|Summary:||Set the wayback machine to DOS 1.0. DOS 1.0 didn't support subdirectories, lowercase, or filenames longer than 8.3. When you ran the assembler (or compiler if you were really fancy) the conversation went something like this: A>asm foo the ".asm" extension on "foo" is implied Assembler version blah blah blah Source file: FOO.ASM Listing...|
Set the wayback machine to DOS 1.0.
DOS 1.0 didn't support subdirectories, lowercase, or filenames longer than 8.3.
When you ran the assembler (or compiler if you were really fancy) the conversation went something like this:
You only had to type the base name of the file; the ".LST" and ".OBJ" extensions were appended automatically. In fact, I don't think you could disable the extensions; they were always added.
But what if you didn't want a listing file? The assembler demanded a filename, and if you didn't type any filename at all, it created one with the same basename as your source file.
That's where the magic filenames come in. Suppose you wanted the listing file to go straight to the printer. You didn't want to create a file on your floppy drive because there might not be enough space to hold it, or just because you didn't want to waste the time creating a file just to delete it anyway. So you typed "PRN" as the filename.
Now, the assembler doesn't know about these magic filenames. So the assembler will try to create the file "PRN.LST" and then start writing to it. Little does the assembler realize that the output is actually going to the printer.
If you wanted to discard the output entirely, you would type "NUL", of course. And if you wanted it to go to the screen, you would type "CON".
Now, if you followed closely, you can see that the above story explains two things already:
But why do we carry these magic filenames forward even today?
Because everybody still relies on them. Just look at all the batch files that do things like redirect to >NUL or test if a directory exists by asking "if exist directoryname\nul", or all the documentation that says to create a file with "copy CON ...".
<-- Back to Old New Thing Archive Index