To open a device using DosOpen, the application must supply the reserved name for that device. For example, to open the console (both keyboard and screen), you must specify the name CON.

The following table shows some of the common reserved device names:

Common Device Names

ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Device Name³Description                                       ³
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³CON        ³The system console. This device consists of both  ³
³           ³the keyboard and the screen. You can open CON for ³
³           ³reading (from the keyboard), writing (to the      ³
³           ³screen), or both.                                 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³COM1       ³Serial port 1. You can open this device for       ³
³           ³reading, writing, or both. Other serial ports will³
³           ³have names in ascending sequence-COM2, COM3, and  ³
³           ³so on.                                            ³
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³PRN        ³The default printer port. This device corresponds ³
³           ³to one of the system's parallel ports, usually    ³
³           ³LPT1. You can open it for writing but not for     ³
³           ³reading.                                          ³
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³LPT1       ³Parallel port 1. You can open this device for     ³
³           ³writing but not for reading. Other parallel ports ³
³           ³will have names in ascending sequence-LPT2, LPT3, ³
³           ³and so on.                                        ³
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³NUL        ³The null device. This device provides a method of ³
³           ³discarding output. If you open this device for    ³
³           ³writing, any data written to the file is          ³
³           ³discarded. If you open the device for reading, any³
³           ³attempt to read from the file returns an          ³
³           ³end-of-file mark.                                 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³SCREEN$    ³The screen. This device can be written to but not ³
³           ³read from. Writing to the screen is similar to    ³
³           ³writing to the system console. Bytes are displayed³
³           ³as characters (unless the ANSI screen driver is   ³
³           ³loaded and the character represents an ANSI escape³
³           ³sequence).                                        ³
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³KBD$       ³The keyboard. This device can be read from but not³
³           ³written to. Reading from the keyboard is similar  ³
³           ³to reading from the system console.               ³
ÀÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

After an application uses a device, it should close it by using DosClose.


[Back] [Next]