summaryrefslogtreecommitdiff
path: root/sys/man/1/pipefile
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
commitb41b9034225ab3e49980d9de55c141011b6383b0 (patch)
tree891014b4c2e803e01ac7a1fd2b60819fbc5a6e73 /sys/man/1/pipefile
parentc558a99e0be506a9abdf677f0ca4490644e05fc1 (diff)
Import sources from 2011-03-30 iso image - sys/man
Diffstat (limited to 'sys/man/1/pipefile')
-rwxr-xr-xsys/man/1/pipefile101
1 files changed, 101 insertions, 0 deletions
diff --git a/sys/man/1/pipefile b/sys/man/1/pipefile
new file mode 100755
index 000000000..19f207f31
--- /dev/null
+++ b/sys/man/1/pipefile
@@ -0,0 +1,101 @@
+.TH PIPEFILE 1
+.SH NAME
+pipefile \- attach filter to file in name space
+.SH SYNOPSIS
+.B pipefile
+[
+.B -d
+] [
+.B -r
+.I command
+] [
+.B -w
+.I command
+]
+.I file
+.SH DESCRIPTION
+.I Pipefile
+uses
+.IR bind (2)
+to attach a pair of pipes to
+.IR file ,
+using them to
+interpose filter
+.I commands
+between the true file and the simulated file that subsequently
+appears in the name space.
+Option
+.B -r
+interposes a filter that will affect the data delivered to programs that read from
+.IR file ;
+.B -w
+interposes a filter that will affect the data written by programs to
+.IR file .
+At least one
+.I command
+must be specified;
+.I pipefile
+will insert a
+.IR cat (1)
+process in the other direction.
+.PP
+After
+.I pipefile
+has been run, the filters are established for programs that subsequently
+open the
+.IR file ;
+programs already using the
+.I file
+are unaffected.
+.PP
+.I Pipefile
+opens the
+.I file
+twice, once for each direction. If the
+.I file
+is a single-use device, such as
+.BR /dev/mouse ,
+use the
+.B -d
+flag to specify that the file is to be opened once, in
+.B ORDWR
+mode.
+.SH EXAMPLES
+Simulate an old terminal:
+.EX
+.IP
+% pipefile -w 'tr a-z A-Z' /dev/cons
+% rc -i </dev/cons >/dev/cons >[2=1]
+% echo hello
+HELLO
+%
+.EE
+.PP
+Really simulate an old terminal:
+.EX
+.IP
+% pipefile -r 'tr A-Z a-z' -w 'tr a-z A-Z' /dev/cons
+% rc -i </dev/cons >/dev/cons >[2=1]
+% DATE
+THU OCT 12 10:13:45 EDT 2000
+%
+.EE
+.SH SOURCE
+.B /sys/src/cmd/pipefile.c
+.SH SEE ALSO
+.IR mouse (8)
+.SH BUGS
+The I/O model of
+.I pipefile
+is peculiar; it doesn't work well on plain files.
+It is really intended for use with continuous devices such as
+.I /dev/cons
+and
+.IR /dev/mouse .
+.I Pipefile
+should be rewritten to be a user-level file system.
+.PP
+If the program using the file managed by
+.I pipefile
+exits, the filter will see EOF and exit, and the file will be unusable
+until the name space is repaired.