Date: Sun, 16 Mar 1997 15:49:44 +0300 (IDT) From: Eli Zaretskii To: Erik Max Francis cc: djgpp AT delorie DOT com Subject: Re: Output to the Printer In-Reply-To: <3328D5A9.59B1D0E6@alcyone.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 13 Mar 1997, Erik Max Francis wrote: > Eli Zaretskii wrote: > > > Nope, it's "COMx" and "LPTx" (no colons). The short program that I > > posted in this thread also fails for "LPT1:", but works for "LPT1". > > > > Generally, DOS disallows file names with a colon (except as part of > > d:pathname), so it's not surprising that the colon doesn't work in > > device names. > > This is interesting, because originally with DOS, the intention was the > opposite. A, B, C, D, etc. are all devices; so are CON, PRN, LPT1, COM1, > etc. The idea is if you want to refer to these devices, you suffix them > with a colon. In the case of devices which contain filesystems, you can > including further stuff to demonstrate where on the device to find them. I'm not sure about how this developed historically, but as things are right now, the colon is not part of any device name. Devices are implemented as device drivers which DOS loads at boot time. When you open() a file, DOS searches the device drivers' chain to see whether any of the devices has a name like the basename of the pathname you pass the open() call, and if it finds such a device, it lets the device driver handle the call; only if the search fails will DOS go to the disk. Since the device names don't include the colon, the search will fail if you use "LPT1:". > Is it the BIOS itself that rejects the colons, or what? No, BIOS doesn't know anything about device/file names. BIOS gets all references resolved to ports, sectors, cylinders and such likes.