Device file system
Encyclopedia
In Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 operating systems, a device file or special file is an interface
Interface (computer science)
In the field of computer science, an interface is a tool and concept that refers to a point of interaction between components, and is applicable at the level of both hardware and software...

 for a device driver
Device driver
In computing, a device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device....

 that appears in a file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

 as if it were an ordinary file
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

. There are also special device files in MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 and Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

. They allow software to interact with a device driver using standard input/output
Input/output
In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world, possibly a human, or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it...

 system call
System call
In computing, a system call is how a program requests a service from an operating system's kernel. This may include hardware related services , creating and executing new processes, and communicating with integral kernel services...

s, which simplifies many tasks and unifies user-space I/O mechanisms.

Device files often provide simple interfaces to peripheral devices, such as printers and serial ports. But they can also be used to access specific resources on those devices, such as disk partitions
Disk partitioning
Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks. Partitions are also termed "slices" for operating systems based on BSD, Solaris or GNU Hurd...

. Finally, device files are useful for accessing system resources
Resource (computer science)
A resource, or system resource, is any physical or virtual component of limited availability within a computer system. Every device connected to a computer system is a resource. Every internal system component is a resource...

 that have no connection with any actual device such as data sinks and random number generators.

MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 borrowed the concept of special files from Unix, but renamed them devices. Because early versions of MS-DOS did not support a directory
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

 hierarchy, devices were distinguished from regular files by making their names reserved word
Reserved word
Reserved words are one type of grammatical construct in programming languages. These words have special meaning within the language and are predefined in the language’s formal specifications...

s. This means that certain file names were reserved for devices, and should not be used to name new files or directories.
The reserved names themselves were chosen to be compatible with "special files" handling of PIP command
Command (computing)
In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell....

 in CP/M
CP/M
CP/M was a mass-market operating system created for Intel 8080/85 based microcomputers by Gary Kildall of Digital Research, Inc...

. There were two kinds of devices in MS-DOS: Block Devices (used for disk drives) and Character Devices (generally all other devices, including COM and PRN devices). PIPE, MAILSLOT, and MUP are other standard Windows devices.

There are two general kinds of device files in Unix-like operating systems, known as character special files and block special files. The difference between them lies in how data written to them and read from them is processed by the operating system and hardware. These together can be called device special files in contrast to named pipe
Named pipe
In computing, a named pipe is an extension to the traditional pipe concept on Unix and Unix-like systems, and is one of the methods of inter-process communication. The concept is also found in Microsoft Windows, although the semantics differ substantially...

s, which are not connected to a device but are not ordinary files either.

Implementation

By definition, device nodes correspond to resources that an operating-system kernel has already allocated. Unix identifies those resources by a major number and a minor number (e.g. where the major and minor number of /dev/urandom is 1 and 9 respectively which may be ascertained using stat
Stat (Unix)
stat is a Unix system call that returns useful data about a file inode. The semantics of stat vary between operating systems. As an example, the Unix command ls uses it to retrieve information on : time of last modification , time of last status change and time of last access .-stat functions and...

 /dev/urandom
, see mknod), both stored as part of the structure of a node
Node (computer science)
A node is a record consisting of one or more fields that are links to other nodes, and a data field. The link and data fields are often implemented by pointers or references although it is also quite common for the data to be embedded directly in the node. Nodes are used to build linked, often...

. The assignment of these numbers occurs uniquely in different operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s and on different computer platforms. Generally, the major number identifies the device driver and the minor number identifies a particular device (possibly out of many) that the driver controls: in this case, the system may pass the minor number to a driver. However, in the presence of dynamic number allocation, this may not be the case (e.g. on FreeBSD 5 and up).

As with other special file types, the computer system accesses device nodes using standard system calls and treats them like regular computer files. Two standard types of device files exist, differentiated by the type of hardware with which they interface and the way the operating system processes input and output operations: character devices and block devices.

Character devices

Character special files or character devices relate to devices through which the system transmits data one character at a time by, for example getchar. These device nodes often serve for stream communication
Byte stream
In computer science, a byte stream is a bit stream, in which data bits are grouped into units, called bytes.In computer networking the term octet stream is sometimes used to refer to the same thing; it emphasizes the use of bytes having the length of 8 bits, known as octets.Formally, a byte stream...

 with devices such as mice, keyboards, virtual terminal
Virtual terminal
In open systems, a virtual terminal is an application service that:# Allows host terminals on a multi-user network to interact with other hosts regardless of terminal type and characteristics,...

s, and serial modems
Modem
A modem is a device that modulates an analog carrier signal to encode digital information, and also demodulates such a carrier signal to decode the transmitted information. The goal is to produce a signal that can be transmitted easily and decoded to reproduce the original digital data...

, and usually do not support random access
Random access
In computer science, random access is the ability to access an element at an arbitrary position in a sequence in equal time, independent of sequence size. The position is arbitrary in the sense that it is unpredictable, thus the use of the term "random" in "random access"...

 to data.

In most implementations, character devices use unbuffered
Buffer (computer science)
In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device or just before it is sent to an output device...

 input and output routines. The system reads each character from the device immediately or writes each character to the device immediately.

Block devices

Block special files or block devices correspond with devices that move data in the form of blocks
Block (data storage)
In computing , a block is a sequence of bytes or bits, having a nominal length . Data thus structured are said to be blocked. The process of putting data into blocks is called blocking. Blocking is used to facilitate the handling of the data-stream by the computer program receiving the data...

 by, for example, fread. These device nodes interface the devices, such as hard disk
Hard disk
A hard disk drive is a non-volatile, random access digital magnetic data storage device. It features rotating rigid platters on a motor-driven spindle within a protective enclosure. Data is magnetically read from and written to the platter by read/write heads that float on a film of air above the...

s, CD-ROM
CD-ROM
A CD-ROM is a pre-pressed compact disc that contains data accessible to, but not writable by, a computer for data storage and music playback. The 1985 “Yellow Book” standard developed by Sony and Philips adapted the format to hold any form of binary data....

 drives, flash drives and other addressable regions of memory.

Block devices support random access and seeking, and generally use buffered
Buffer (computer science)
In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device or just before it is sent to an output device...

 input and output routines. The operating system allocates a data buffer to hold a single block each for input and output. When a program sends a request to read data from or to write data to the device, the system stores each character of that data in the appropriate buffer. When the buffer fills up, the appropriate operation takes place (data transfer) and the system clears the buffer.

Pseudo-devices

Device nodes on Unix-like systems do not necessarily have to correspond to physical devices. Nodes that lack this correspondence form the group of pseudo-devices. They provide various functions handled by the operating system. Some of the most commonly-used (character-based) pseudo-devices include:

/dev/null
/dev/null
In Unix-like operating systems, /dev/null or the null device is a special file that discards all data written to it and provides no data to any process that reads from it ....

:Accepts and discards all input; produces no output.
/dev/zero
/dev/zero
/dev/zero is a special file in Unix-like operating systems that provides as many null characters as are read from it. One of the typical uses is to provide a character stream for initializing data storage.-Function:...

:Produces a continuous stream of NUL
Null character
The null character , abbreviated NUL, is a control character with the value zero.It is present in many character sets, including ISO/IEC 646 , the C0 control code, the Universal Character Set , and EBCDIC...

 (zero value) bytes.
/dev/random
/dev/random
In Unix-like operating systems, /dev/random is a special file that serves as a random number generator or as a pseudorandom number generator. It allows access to environmental noise collected from device drivers and other sources. Not all operating systems implement the same semantics for /dev/random...

:Produces a variable-length stream of pseudo-random or truly random
Random number generation
A random number generator ) is a computational or physical device designed to generate a sequence of numbers or symbols that lack any pattern, i.e. appear random....

 numbers. (Blocking
Blocking (computing)
Blocking occurs when a subroutine does not return until it either completes its task or fails with an error or exception. A process that is blocked is one that waits for some event, such as a resource becoming available or the completion of an I/O operation.In a multitasking computer system,...

)
/dev/urandom:Produces a variable-length stream of pseudo-random numbers. (Non-Blocking)
/dev/full
/dev/full
In Linux, /dev/full or the always full device is a special file that always returns No space left on device on writing, and provides infinite number of null characters to any process that reads from it...

:Produces a continuous stream of NUL
Null character
The null character , abbreviated NUL, is a control character with the value zero.It is present in many character sets, including ISO/IEC 646 , the C0 control code, the Universal Character Set , and EBCDIC...

 (zero value) bytes when read, and returns a "disk full" message when written to.

Node creation

Nodes are created by the mknod system call. The command-line program for creating nodes has the same name. Nodes can be moved or deleted by the usual filesystem system calls (rename
Rename
Rename is a word meaning change the name of something. Different areas, such as linguistics, relational algebra, and computer science incur renaming actions with different detailed activity, however the principles behind are all the same — change the name of something.Specific uses:* Rename...

, unlink
Unlink (Unix)
In Unix-like operating systems, unlink is a system call and a command line utility to delete files. The program directly interfaces the system call, which removes the file name and directories like rm and rmdir...

) and commands (mv
Mv
mv is a Unix command that moves one or more files or directories from one place to another. Since it can "move" files from one filename to another, it is also used to rename files. Using mv requires the user to have write permission for the directories which the file will move between...

, rm
Rm (Unix)
rm is a basic UNIX command used to remove objects such as files, directories, device nodes, symbolic links, and so on from the filesystem...

). When passed the option -R or -a while copying a device node, the cp -l
Cp (Unix)
cp is a UNIX command used to copy a file. Files can be copied either to the same directory or to a completely different directory, possibly on a different file system or hard disk drive. If the file is copied to the same directory, the new file must have a different name to the original; in all...

command creates a new device node with the same attributes of the original.

Some Unix versions include a script named makedev or MAKEDEV to create all necessary devices in the directory /dev. It only makes sense on systems whose are statically assigned major numbers (e.g. by means of hardcoding it in their kernel module).

Linux Naming conventions

The following prefixes have come into common use in Linux-based systems, to identify the type of a device driver interface in the /dev hierarchy:
  • fb: frame buffer
  • fd: (platform) floppy disk
    Floppy disk
    A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...

    s, though this same abbreviation is also commonly used to refer to file descriptor
    File descriptor
    In computer programming, a file descriptor is an abstract indicator for accessing a file. The term is generally used in POSIX operating systems...

  • hd: (“classic”) IDE driver (previously used for ATA hard disk drive, ATAPI optical disc drives, etc.)
    • hda: the master device on the first ATA channel (usually identified by major number 3 and minor number 0)
    • hdb: the slave device on the first ATA channel
    • hdc: the master device on the second ATA channel
      • hdc1: first partition on this disk (example)
      • hdc5: first logical drive in the extended partition (example)
    • hdd: the slave device on the second ATA channel
  • lp: line printer
    Computer printer
    In computing, a printer is a peripheral which produces a text or graphics of documents stored in electronic form, usually on physical print media such as paper or transparencies. Many printers are primarily used as local peripherals, and are attached by a printer cable or, in most new printers, a...

    s (compare lp
    Lp (Unix)
    The lp command is used on many Unix-like systems to assign jobs to printer queues. The name derives from "lineprinter", though it has become the commonly used command for any sort of printer...

    )
  • parport, pp: parallel port
    Parallel port
    A parallel port is a type of interface found on computers for connecting various peripherals. In computing, a parallel port is a parallel communication physical interface. It is also known as a printer port or Centronics port...

    s
  • pt: pseudo-terminal
    Pseudo terminal
    In some operating systems, including Unix, a pseudo terminal is a pseudo-device pair that provides a text terminal interface without an associated device, such as a virtual console, computer terminal or serial port...

    s (virtual terminals)
  • SCSI
    SCSI
    Small Computer System Interface is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, and electrical and optical interfaces. SCSI is most commonly used for hard disks and tape drives, but it...

     driver, also used by libata
    LibATA
    libATA is a library used inside the Linux kernel to support ATA host controllers and devices. libATA provides an ATA driver API, class transports for ATA and ATAPI devices, and SCSI/ATA translation for ATA devices according to the T10 SAT specification...

     (modern PATA/SATA
    Serial ATA
    Serial ATA is a computer bus interface for connecting host bus adapters to mass storage devices such as hard disk drives and optical drives...

     driver), USB
    Universal Serial Bus
    USB is an industry standard developed in the mid-1990s that defines the cables, connectors and protocols used in a bus for connection, communication and power supply between computers and electronic devices....

    , IEEE 1394, etc.
    • sd: mass-storage driver
      • sda: first registered device
        • sda4: last partition on this disk (example)
        • sda6: second logical drive in the extended partition (example)
    • ses: Enclosure driver
    • sg: generic SCSI layer
    • sr: “ROM” driver (data-oriented optical disc drives; scd is just a secondary alias)
    • st: magnetic tape
      Magnetic tape
      Magnetic tape is a medium for magnetic recording, made of a thin magnetizable coating on a long, narrow strip of plastic. It was developed in Germany, based on magnetic wire recording. Devices that record and play back audio and video using magnetic tape are tape recorders and video tape recorders...

       driver
  • tty: terminal
    Computer terminal
    A computer terminal is an electronic or electromechanical hardware device that is used for entering data into, and displaying data from, a computer or a computing system...

    s
    • ttyS: (platform) serial port
      Serial port
      In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time...

       driver
    • ttyUSB: USB serial converters, modems, etc.


The canonical list of these prefixes can be found in the Linux Device List, the official registry of allocated device numbers and /dev directory nodes for the Linux operating system.

For most devices, this prefix is followed by a number uniquely identifying the particular device. For hard drives, a letter is used to identify devices and is followed by a number to identify partitions
Disk partitioning
Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks. Partitions are also termed "slices" for operating systems based on BSD, Solaris or GNU Hurd...

. Thus a file system may "know" an area on a disk as /dev/sda3, for example, or "see" a networked terminal session as associated with /dev/pts/14.

On disks using the typical PC master boot record
Master boot record
A master boot record is a type of boot sector popularized by the IBM Personal Computer. It consists of a sequence of 512 bytes located at the first sector of a data storage device such as a hard disk...

, the device numbers of primary and the optional extended partition are numbered 1 through 4, while the indexes of any logical partitions are 5 and onwards, regardless of the layout of the former partitions (their parent extended partition does not need to be the fourth partition on the disk, nor do all four primary partitions have to exist).

Device names are usually not portable between different Unix-like system variants, for example, on some BSD systems, the IDE devices are named /dev/wd0, /dev/wd1, etc.

devfs

devfs is a specific implementation of a device file system on Unix-like operating systems, used for presenting device files. The underlying mechanism of implementation may vary, depending on the OS.

Maintaining these special files on a general-purpose file system is inconvenient, and as it needs kernel assistance anyway, the idea of a special-purpose file system that is not stored on disk arose.

Also defining when devices are ready to appear is not entirely trivial. The 'devfs' approach is for the device driver to request creation and deletion of 'devfs' entries related to the devices it enables and disables.

Implementations

Operating System Filesystem or managing software Standard mount point Author Notes
Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 2.3.46pre5–2.6.17
devfs /dev Richard Gooch
Richard Gooch
Richard Gooch may refer to:*Sir John Sherlock Gooch, 12th Baronet of the Gooch Baronets*Richard Frank Sherlock Gooch, List of Gentlemen Ushers*Richard Gooch, one of the Candidates of the Australian federal election, 2001...

Implemented fully in the kernel. DEPRECATED: Users are encouraged to migrate to udev.
Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 2.5–
udev
Udev
udev is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all user space actions when adding/removing devices, including firmware load.-History:udev was new in Linux...

 on any fs, but usually tmpfs
TMPFS
tmpfs is a common name for a temporary file storage facility on many Unix-like operating systems. It is intended to appear as a mounted file system, but stored in volatile memory instead of a persistent storage device...

/dev Greg Kroah-Hartman
Greg Kroah-Hartman
Greg Kroah-Hartman is a Linux kernel developer. He is the current Linux kernel maintainer for the -stable branch with Chris Wright, the staging subsystem, USB, driver core, debugfs, kref, kobject, and the sysfs kernel subsystems, Userspace I/O and TTY layer. He is also the maintainer of the...

, Kay Sievers and Dan Stekloff
Implemented largely in user space, device information is gathered from sysfs
Sysfs
Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to user space, and is also used for configuration...

. Device files can be stored on a conventional general-purpose file system, or in a memory file system (tmpfs
TMPFS
tmpfs is a common name for a temporary file storage facility on many Unix-like operating systems. It is intended to appear as a mounted file system, but stored in volatile memory instead of a persistent storage device...

).
Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 2.6.32–
devtmpfs with or without udev /dev Kay Sievers, Jan Blunck, Greg Kroah-Hartman
Greg Kroah-Hartman
Greg Kroah-Hartman is a Linux kernel developer. He is the current Linux kernel maintainer for the -stable branch with Chris Wright, the staging subsystem, USB, driver core, debugfs, kref, kobject, and the sysfs kernel subsystems, Userspace I/O and TTY layer. He is also the maintainer of the...

A hybrid kernel/userspace approach of a device filesystem to provide nodes before udev runs for the first time
Solaris /dev Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

 2.0–
devfs /dev Poul-Henning Kamp
Poul-Henning Kamp
Poul-Henning Kamp is a Danish FreeBSD developer, responsible for implementation of the widely used MD5 password hash algorithm, a vast quantity of systems code, including the FreeBSD GEOM storage layer, GBDE cryptographic storage transform, part of the UFS2 file system implementation, FreeBSD...

Implemented fully in the kernel.
DragonFly BSD
DragonFly BSD
DragonFly BSD is a free Unix-like operating system created as a fork of FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and a FreeBSD developer between 1994 and 2003, began work on DragonFly BSD in June 2003 and announced it on the FreeBSD mailing lists on July...

 2.3.2–
devfs /dev Alex Hornung Implemented fully in the kernel.
Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

devfs /dev Apple Inc. Implemented fully in the kernel.
HP-UX
HP-UX
HP-UX is Hewlett-Packard's proprietary implementation of the Unix operating system, based on UNIX System V and first released in 1984...

 B.11.31
devfs /dev HP Implemented fully in the kernel.
Plan 9
Plan 9 from Bell Labs
Plan 9 from Bell Labs is a distributed operating system. It was developed primarily for research purposes as the successor to Unix by the Computing Sciences Research Center at Bell Labs between the mid-1980s and 2002...

# Bell Labs
Bell Labs
Bell Laboratories is the research and development subsidiary of the French-owned Alcatel-Lucent and previously of the American Telephone & Telegraph Company , half-owned through its Western Electric manufacturing subsidiary.Bell Laboratories operates its...

Implemented in kernel. Cannot be mounted elsewhere or unmounted.
MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

, PC DOS, DR-DOS
DR-DOS
DR-DOS is an MS-DOS-compatible operating system for IBM PC-compatible personal computers, originally developed by Gary Kildall's Digital Research and derived from Concurrent PC DOS 6.0, which was an advanced successor of CP/M-86...

\DEV various As implemented in the kernel, character devices appear in the virtual \DEV directory and any disk directory. Under MS-DOS/PC DOS 2.x, the CONFIG.SYS
CONFIG.SYS
CONFIG.SYS is the primary configuration file for the DOS, OS/2 as well as similar operating systems. It is a special file that contains setup or configuration instructions for the computer system.- Usage :...

 AVAILDEV=FALSE directive can be used to force devices to exist only in \DEV.
Windows 9x
Windows 9x
Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced since 1995, which were based on the original and later modified Windows 95 kernel...

\\devices\ Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...


Device files

A device file is a reserved keyword used in MS-DOS and MS-DOS–based systems to allow access to certain ports and devices.

MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 uses device files 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. A common misconception is that these are bugs which Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 has failed to fix.
Device keyword 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 Reads data from an auxiliary device, usually a serial port. Sends data to an auxiliary 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 shell redirection and 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 or printers.

See also

  • Sysfs
    Sysfs
    Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to user space, and is also used for configuration...

  • Block size
    Block (data storage)
    In computing , a block is a sequence of bytes or bits, having a nominal length . Data thus structured are said to be blocked. The process of putting data into blocks is called blocking. Blocking is used to facilitate the handling of the data-stream by the computer program receiving the data...

  • Blocking
    Asynchronous I/O
    Asynchronous I/O, or non-blocking I/O, is a form of input/output processing that permits other processing to continue before the transmission has finished....

  • Buffer
    Buffer (computer science)
    In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device or just before it is sent to an output device...

  • File system
    File system
    A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...


  • Hardware abstraction
    Hardware abstraction
    Hardware abstractions are sets of routines in software that emulate some platform-specific details, giving programs direct access to the hardware resources....

  • User space
    User space
    A conventional computer operating system usually segregates virtual memory into kernel space and user space. Kernel space is strictly reserved for running the kernel, kernel extensions, and most device drivers...

  • Unix file types
    Unix file types
    For normal files in the file system, Unix does not impose or provide any internal file structure.This implies that from the point of view of the operating system, there is only one file type....

  • udev
    Udev
    udev is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all user space actions when adding/removing devices, including firmware load.-History:udev was new in Linux...



External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK