Device name

From Wikipedia, the free encyclopedia

A device name is a reserved keyword used in some operating systems to allow access to certain ports and devices.

[edit] MS-DOS and MS-DOS–based systems

MS-DOS uses devices names for access to printers and ports. Most versions of windows also contain this support, which can cause confusion when trying to make files and folders of certain names, as they cannot have these names.[1] A common misconception is that these are bugs which Microsoft has failed to fix.

Device keyword[1] Use as input Use as output
CON Receives typed data until ^Z (Ctrl-Z) is pressed. Prints data to the console.
PRN N/A Prints text to the printer.
AUX Sends data to an auxillary device, usually a serial port. Reads data from an auxillary device, usually a serial port.
NUL Returns null or no data. Discards received data.
CLOCK$ Returns system real-time clock. N/A
LPT1 (also 2-9) Reads data from the selected parallel port Sends data to the selected parallel port
COM1 (also 2-9) Reads data from the selected serial port Sends data to the selected serial port

Using pipes, data can be sent to or received from a device. For example, typing 'type c:\data.txt > PRN' will send the file c:\data.txt to the printer, although this may not work on all systems.

[edit] References