next up previous contents
Next: File Permissions Up: File Types and Permissions Previous: File Types and Permissions

Types of Files

 

We already met three types of files in our discussion of the ls command: the ordinary file, the directory and the symbolic link.

The special directory, /dev is a directory used to collect all of the special hardware this computer has, and most of the hardware it can be used with. The two most common files in this directory are the block special device (b) and the character special device (c). Block devices, like hard disks, are accessed by reading or writing blocks of data (512, 1024, 2048, ...bytes at a time). Character devices are accessed one byte at a time.

Other kinds of files are named pipes (p) (also known as fifo's) and sockets (s).

We've run across the word pipe already, in connection with the idea of how to connect the input of one program to the output of another program. A named pipe is a generalisation of this, it is a way for allowing 2 programs on the same computer to communicate which each other, via a name in the filesystem. Some client -- server packages are implemented by having the two processes communicate via named pipes.

A socket is a further generalisation of this, allowing 2 programs to communicate via networking protocols.

I seen one message in netnews about someone who noticed a file where the first character in the long listing was an asterisk (*). Concensus was that the filename actually had a carriage return followed by an asterisk in it, and so the long listing gave the appearance of having a strange entry.


next up previous contents
Next: File Permissions Up: File Types and Permissions Previous: File Types and Permissions

Gordon Haverland
Sat Oct 9 13:50:48 MDT 1999