Make special files. Obviously this (the underlying system call, actually) gets used a lot in /dev, but there are other uses. I often use this to make a device file for printing to (see How can I make a device that will print to a network printer?), and the same general idea is useful for other schemes. I've used it to let a non-privileged user send commands to a root process - the user writes to the named pipe, and a root process reads it and acts appropriately (you wouldn't want to literally execute whatever the user writes - you would do this for a specific purpose, such as copying data written to a file in a protected directory, etc.).
On some systems there is a specific "mkfifo" command; mknod is more general purpose.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-04-28 Tony Lawrence
A learning experience is one of those things that say, "You know that thing you just did? Don't do that." (Douglas Adams)
mkfifo exists in SCO OSR5 and may be used to create a named pipe (FIFO). It has the syntax:
mkfifo [-m] pathname
The -m option may be used to set the permissions on the newly-created fifo. For example:
mkfifo -m 666 /dev/mypipe
--BigDumbDinosaur
Printer Friendly Version
mknod Copyright © November 2003 Tony Lawrence
Have you tried Searching this site?
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.
Contact us
Printer Friendly Version