Blob


1 .TH 9P 1
2 .SH NAME
3 9p \- 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
46 is a trivial 9P client that can access a single file on a 9P server.
47 It can be useful for manual interaction with a 9P server or for
48 accessing simple 9P services from within shell scripts.
49 .PP
50 The first argument is a command, one of:
51 .TP
52 .B read
53 print the contents of
54 .I path
55 to standard output
56 .TP
57 .B write
58 write data on standard input to
59 .I path
60 .TP
61 .BR readfd ", " writefd
62 like
63 .B read
64 and
65 .B write
66 but use
67 .IR openfd (9p)
68 instead of
69 .IR open ;
70 this masks errors and is mainly useful for debugging
71 the implementation of
72 .I openfd
73 .TP
74 .B stat
75 execute
76 .I stat (9p)
77 on
78 .I path
79 and print the result
80 .PD
81 .PP
82 .I 9p
83 dials
84 .I address
85 to connect to the 9P server.
86 If the
87 .B -a
88 option is not given,
89 .I 9p
90 requires the
91 .I path
92 to be of the form
93 .IB service / subpath \fR;
94 it connects to the Unix domain socket
95 .I service
96 in the name space directory
97 (see
98 .IR intro (4))
99 and then accesses
100 .IR subpath .
101 .SH EXAMPLE
102 To update
103 .IR plumber (4)'s
104 copy of your plumbing rules after editing
105 .BR $HOME/lib/plumbing :
106 .IP
107 .EX
108 cat $HOME/lib/plumbing | 9p write plumb/rules
109 .EE
110 .PP
111 To display the contents of the current
112 .IR acme (4)
113 window (specified by the environment variable
114 .BR $winid )
115 on standard output:
116 .IP
117 .EX
118 9p read acme/$winid/body
119 .EE
120 .SH SOURCE
121 .B /usr/local/plan9/src/cmd/9p.c
122 .SH SEE ALSO
123 .IR intro (4),
124 .IR intro (9p),
125 .IR 9pclient (3)