blob: a90ac4d23b0a2e51731fe7b220f5af970fe5f49a [file] [log] [blame]
rsc058b0112005-01-03 06:40:20 +00001.TH 9P 1
2.SH NAME
39p \- read and write files on a 9P server
4.SH SYNOPSIS
5.B 9p
6[
7.B -a
8.I addr
9]
10.B read
11.I path
12.br
13.B 9p
14[
15.B -a
16.I addr
17]
18.B readfd
19.I path
20.PP
21.B 9p
22[
23.B -a
24.I addr
25]
26.B write
27.I path
28.br
29.B 9p
30[
31.B -a
32.I addr
33]
34.B writefd
35.I path
36.PP
37.B 9p
38[
39.B -a
40.I addr
41]
42.B stat
43.I path
44.SH DESCRIPTION
45.I 9p
46is a trivial 9P client that can access a single file on a 9P server.
47It can be useful for manual interaction with a 9P server or for
48accessing simple 9P services from within shell scripts.
49.PP
50The first argument is a command, one of:
51.TP
52.B read
53print the contents of
54.I path
55to standard output
56.TP
57.B write
58write data on standard input to
59.I path
60.TP
61.BR readfd ", " writefd
62like
63.B read
64and
65.B write
66but use
67.IR openfd (9p)
68instead of
69.IR open ;
70this masks errors and is mainly useful for debugging
71the implementation of
72.I openfd
73.TP
74.B stat
75execute
76.I stat (9p)
77on
78.I path
79and print the result
80.PD
81.PP
82.I 9p
83dials
84.I address
85to connect to the 9P server.
86If the
87.B -a
88option is not given,
89.I 9p
90requires the
91.I path
92to be of the form
93.IB service / subpath \fR;
94it connects to the Unix domain socket
95.I service
96in the name space directory
97(see
98.IR intro (4))
99and then accesses
100.IR subpath .
101.SH EXAMPLE
102To update
103.IR plumber (4)'s
104copy of your plumbing rules after editing
105.BR $HOME/lib/plumbing :
106.IP
107.EX
108cat $HOME/lib/plumbing | 9p write plumb/rules
109.EE
110.PP
111To display the contents of the current
112.IR acme (4)
113window (specified by the environment variable
114.BR $winid )
115on standard output:
116.IP
117.EX
1189p read acme/$winid/body
119.EE
120.SH SOURCE
rscc3674de2005-01-11 17:37:33 +0000121.B \*9/src/cmd/9p.c
rsc058b0112005-01-03 06:40:20 +0000122.SH SEE ALSO
123.IR intro (4),
124.IR intro (9p),
125.IR 9pclient (3)