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