We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Hardware

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is a Special File?

By Jessica Reed
Updated: May 16, 2024
Views: 10,868
Share

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.

Share
EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
By Charred — On Sep 02, 2011

@allenJo - What I liked most about the device files was the ability to use named pipes. These were a way to redirect the output of your command.

You could take a sample file and either print out its contents or simply output them to the console window, using these pipes. The pipes were just special characters that told the device file how to treat the output.

By allenJo — On Sep 01, 2011

@SkyWhisperer - I remember those days. We also used device files back in the good old days of dial-up modems.

Sometimes we would have problems connecting to a local bulletin board service (this was before the Internet was all the rage). So I would use COM commands to send special characters to the modem as part of the troubleshooting process.

It was kind of cryptic, sending and receiving all of these characters. Most of them were known as AT commands, because they started with that prefix, and were used to reset the modem when it hung or to dial a certain number. We’ve certainly come a long way since then.

By SkyWhisperer — On Aug 31, 2011

In the early days of DOS, I worked with special files a lot. They were known as device files for DOS, like the article says, and they gave me a quick and easy way to debug programs I was working on.

Back then all of my coding was done in console mode, and so from time to time I would want a hard copy of the code. I would issue the PRN command at the console mode and give it the target name of the file I wanted printed.

The device file started reading the file and printed it directly to my old dot matrix printer. It was nothing fancy, but it was good enough for me to be able to look over my work in printed form.

Share
https://www.easytechjunkie.com/what-is-a-special-file.htm
Copy this link
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.