Pipefs
NAME
pipefs
SYNOPSIS
pipefs [ -s srvname ] [ -m mntpoint ] [ -p pmod ] command [ arg ... ]
DESCRIPTION
pipefs
pipes between two different name spaces.The srvname default is
pipefs
.The most simple usage
pipefs /bin/foowill create
/srv/foo
with permission mode 666
.
EXAMPLES
The following shows trivial usage:term% pipefs tr a-z A-Z term% mount /srv/pipefs /n/temp term% echo blah >>/n/temp/data BLAH term% echo hellow >>/n/temp/data HELLOW term%This example is worthless because two processes are in the same name space.
The real value of pipefs is to create a pipe between two different name space.
In name space A:
pipefs /bin/foowill create /srv/pipefs
In name space B:
mount /srv/pipefs /n/pipefs echo 'Hello world' > /n/pipefs/datawill invoke "
/bin/foo
" and the data "Hello world
" will be read by "/bin/foo
" and enables "/bin/foo
" to do something in accordance with the input.
CONSIDERATION
Plan 9 pipe is bidirectional. So, we can get output of the command. Especially error information is useful. Why discard the output?
Reading output has some problems:
- then we can't use simple tool such as echo.
- reading output will waste time and might cause problems.
You should design "/bin/boo
" to do only small tasks.
SOURCE
http://plan9.aichi-u.ac.jp/netlib/pipefs