Everything2
Near Matches
Ignore Exact
Full Text
Everything2

special file

created by avjewe

(idea) by avjewe (4.8 hr) (print)   ?   (I like it!) Fri Apr 06 2001 at 15:22:19

Special file is used in two ways. The looser way refers to anything that is not a plain file, and includes directories, sockets, named pipes and symbolic links, as well as the deviecs described by the more exacting definition.

A special file informs the operating system about the location of the device it's associated with and the means by which it can communicate with the device.

Special files are created with the mknod command and are stored in /dev (also /devices for SunOS 5.X).

Once a special file exists I/O is performed with the device simply by reading or writing to the associated file.

All I/O devices are classified as either block or character (raw) devices. The block special device causes the I/O to be buffered in large pieces. The character (raw) device causes I/O to occur one character (byte) at a time. Some devices, such as disks and tapes, can be both block and character devices, and must have entries for each mode. Terminals operate in character mode. The first entry in the permission field indicates either b-->block, or c-->character.

In Perl there are various file test operators to see if a file is special. Under the more exacting definition, the are -b and -c which return true if a file is a blocm special file or character special file, respectively.

For the looser definition, there is -f which tells you when a file is in no way special. Use -d to look for a directory, -S for a socket, -p for a named pipe and -l for a symbolic link.


printable version
chaos

mknod device file named pipe /dev
DMA directory plain file Permission
I/O file test operator Swap
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Look at this mess the Death Borg made!
Beer
1,340,666 women just like me
golf ball
Critique of Objectivism
The Picture of Dorian Gray
BattleTech
The Argument Culture
Limitations on Artificial Intelligence
Dirty Harry
The Dhammapada
Eric Burdon
There is Nowhere Left to Go When You're The Handsomest Man in the World
Saving Private Ryan
New Writeups
SubSane
Making Love to a 9-Foot Woman(person)
Ouzo
Thoughts(idea)
antigravpussy
I fall silent, listening. The breadcrumbs are talking about us(person)
calgon
Buffalo Bill by the pool(poetry)
gate
Anarchy is Order(idea)
ushdfgakjasgh
Scribeling(thing)
XWiz
Trism(review)
artman2003
Briefcase Full of Souls - Part I(fiction)
Dreamvirus
Alan Ladd(person)
waverider37
Harold Holt(person)
The Debutante
Until death do us part(fiction)
Ysardo
a brother to a sister(personal)
antigravpussy
your warm whispers(personal)
Clarke
Multiculturalism(idea)
aneurin
Earl of Landaff(person)
E2 is a by-product of the existence of The Everything Development Company