1
0

9pcon 2.2 KB

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