in reply to Reading from the keyboard in Win32 without using STDIN

This is an artifact of the CP/M heritage of DOS/Windows. Under CP/M many programs didn't have a "print" function; you would just save to "prn". Since some programs always appended an extension (e.g. ".txt") when saving to disk(ette), the OS would ignore file extensions when writing to device driver names.

When PC-DOS started to support subdirectories in version 2.0, they ignored the subdirectory part while checking for device names. So you could still just save to "prn.txt" in any subdirectory and have your data printed. In the name of "backward compatibility" this behavior is still present in Windows today.

  • Comment on Re: Reading from the keyboard in Win32 without using STDIN