1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
.TH 9PCON 8
.SH NAME
9pcon \- 9P to text translator
.SH SYNOPSIS
.B aux/9pcon
[
.B -cn
]
[
.B -m
.I msize
]
.I service
.SH DESCRIPTION
.I 9pcon
provides a textual interface to
.IR service ,
a conventional 9P server.
By default,
.I 9pcon
interprets
.I service
as a file to be opened.
The
.B -c
flag causes
.I 9pcon
to interpret
.I service
as a command to run which will carry out a
(binary) 9P
conversation over file descriptors 0 and 1.
The
.B -n
flag
causes
.I 9pcon
to interpret
.I service
as a network address to dial.
.PP
Once the connection is established,
.I 9pcon
prints R-messages as they arrive from the server,
and sends T-messages as they are typed on standard input.
There is no prompt.
Lines beginning with # are ignored.
The syntax for T-messages is one of:
.IP
.B Tversion
.I msize
.I version
.br
.B Tauth
.I afid
.I uname
.I aname
.br
.B Tattach
.I fid
.I afid
.I uname
.I aname
.br
.B Twalk
.I fid
.I newfid
.I wname...
.br
.B Topen
.I fid
.I mode
.br
.B Tcreate
.I fid
.I name
.I perm
.I mode
.br
.B Tread
.I fid
.I offset
.I count
.br
.B Twrite
.I fid
.I offset
.I data
.br
.B Tclunk
.I fid
.br
.B Tremove
.I fid
.br
.B Tstat
.I fid
.br
.B Twstat
.I fid
.I name
.I uid
.I gid
.I mode
.I mtime
.I length
.br
.B Tflush
.I oldtag
.LP
See
.IR intro (5)
for a description of the fields in each message.
For the most part, the syntax mirrors the description
of the messages in section 5.
The exceptions are that
the tags on the T-messages are added automatically;
.BR Twalk 's
.I nwname
count is inferred from the number of
.I wnames
given;
and
.BR Twstat 's
.I dir
is in expanded form rather than being an opaque byte sequence.
Note that since commands are parsed with
.B tokenize
(see
.IR getfields (2)),
it is easy to pass empty strings for absent
.IR name ,
.IR uid ,
and
.I gid
fields.
To ease specifying default integer fields, the
.B Twstat
message recognizes
.B ~0
in the
.IR mode ,
.IR mtime ,
and
.I length
arguments.
For example,
.EX
Twstat 101 '' '' sys ~0 ~0 ~0
.EE
sends a
.I wstat
message that attempts to change the group id associated with fid 101.
.SH SOURCE
.B /sys/src/cmd/aux/9pcon.c
.SH SEE ALSO
.IR intro (5)
.SH BUGS
There should be a flag to wait for responses,
to facilitate scripting.
|