Mounted file system, pipe, special file: block, character in UNIX

In UNIX, path names can’t be prefixed by a drive name. To access a CD ROM in UNIX, it has to be mounted on a particular directory. A CD ROM can be mounted to the root or to a particular directory as per the requirements.

For Example: Below given is a file structure before mounting the CD ROM:

 File structure before mounting the CD ROM

and here is the file structure in the CD ROM:

File structure in the CD ROM

Now, say the CD ROM is mounted to the directory A. Here, the CD ROM becomes the part of the file structure. To access a file in C, the path can be followed is: /A/C

 File structure after mounting the CD ROM

Special file: By using the concept of a special file an input and output device can be treated as a file. Special files are put in /dev directory.

There are two types of special files:

Block special files: A block special file is used for a disk where the disk can be divided in to addressable blocks.

Character special files: It is used for devices which input or output a character stream like printers and modems.

Pipe: Pipe is a pseudo file which is used for connecting two processes. It is used for communication between two processes. When a process wants to communicate with another process then it writes data to the pipe. The other process can read the data from the pipe.


Leave a Reply