Device File
In Unix almost all things are handled as files and have a location in the file system — even hardware devices like hard drives. The great exception for devices and the files that represent them are network devices that do not turn up in the file system but are handled separately.
Device files are used to apply access rights and to direct operations on the files to the appropriate device drivers.
Unix makes a distinction between character devices and block devices. The distinction is roughly as follows:
- character devices provide only a serial stream of input or output;
- block devices are randomly accessible;
although, for example, disk partitions may have both character devices that provide unbuffered random access to blocks on the partition and block devices that provide buffered random access to blocks on the partition.
A character device is marked with a c
as the first letter of the mode string. Likewise, a block device is marked with a b
, e.g.
Read more about this topic: Unix File Types
Famous quotes containing the words device and/or file:
“The man who pretends that the distribution of income in this country reflects the distribution of ability or character is an ignoramus. The man who says that it could by any possible political device be made to do so is an unpractical visionary. But the man who says that it ought to do so is something worse than an ignoramous and more disastrous than a visionary: he is, in the profoundest Scriptural sense of the word, a fool.”
—George Bernard Shaw (18561950)
“A common and natural result of an undue respect for law is, that you may see a file of soldiers, colonel, captain, corporal, privates, powder-monkeys, and all, marching in admirable order over hill and dale to the wars, against their wills, ay, against their common sense and consciences, which makes it very steep marching indeed, and produces a palpitation of the heart.”
—Henry David Thoreau (18171862)