Quote:
Originally Posted by
royalibrahim
What is the need for "p" after myfifo? what is it meant for?
mknod is the unix command for creating special files. A pipe is a type of special file, and with the "p" option you tell mknod to create a FIFO (aka named pipe).
varungupta has explained the behaviour of normal command piping. In this case, the OS creates a temporary file for doing the work (a pipe), but you cannot reference explicitly this pipe by name, because is managed internally by the OS.
If you specifically need to put in communication two or more processes through NAMED pipes, you have to create a FIFO with mknod as explained before. In this manner you can reference explicitly the file on disk.
Generally, named pipes are used in the cases where a specific command line utility doesn't accept pipes as input, and you are forced to pass a phisical file to the utility as the input data. For these situations, named pipes are the answer.