How do you create special files like named pipes and device files?
Using the mknod command, special files can be created.
Mknod [options] name type[major minor]
Here, if argument is “p” a named pipe of FIFO file is created.
If the argument is “b”, a block file is created. Here, the major or minor device numbers needs to be specified.
If the argument is “c or u”, a character file is created. Here, the major or minor device numbers needs to be specified.
How do you create special files like named pipes and device files?
Special files are created by the system call ‘mknod’. Upon using the following sequence of steps, a special file will be created.
-new inode is assigned by kernel
-sets the file type as a pipe, directory or special file
-Major and minor device numbers are the two entries created if the file type is a device file.
For example, for a disk, disk controller is the major device number and the disk is the minor device is the disk.
Unix example: $ mknod <pipe name> p