What is a Special File?

A special file, also known as a device file, is a file on a computer that is used with device drivers. It may appear and act like a normal file, but it includes a special name that distinguishes it from other files. This name cannot be used with any other file types. The special file can give commands to a device driver through Input/Output (I/O) system calls. This makes it easier for the file to control a specific device or part of the computer system.

A device node stores information about the special file, and uses a major and a minor number to identify the file and the driver it works with. Microsoft uses special files in their operating systems, such as the system MS-DOS and Windows. An important difference is the name and how the special file is distinguished. Microsoft refers to special files as device files, and older operating systems use reserve words to identify these special files instead of major and minor numbers.

Microsoft’s device files have simple keywords such as CON and PRN. They may or may not have both an input and an output command. For example, CON can both receive typed data and print computer data to the console. The keyword PRN, however, can only print text. It cannot receive any input.

To better understand how special files affect people in their day to day lives, consider a college student who has saved her term paper onto a CD-ROM to take to the campus library and print. Once she puts the CD into the computer, the computer needs to read the data on the CD and open it on the computer so the student can send it to the printer. A type of special file, known as a block device, transfers the data in blocks from the CD to the computer. Once all the blocks have been transferred, the computer can display the contents of the CD onto the computer screen.

Aside from block devices, character devices and pseudo-devices also exist. Character devices work with systems which send information one character at a time instead of in large blocks like the block devices handle. The pseudo-devices are used to interact with commands the operating system can perform that do not require a physical object to interact with. The CD-ROM is a physical object handled by a block device. A pseudo-device deals purely with commands and doesn’t interact with any physical objects.