Blob
1 .TH 9P 12 .SH NAME3 9p \- read and write files on a 9P server4 .SH SYNOPSIS5 .B 9p6 [7 .B -a8 .I addr9 ]10 .B read11 .I path12 .br13 .B 9p14 [15 .B -a16 .I addr17 ]18 .B readfd19 .I path20 .PP21 .B 9p22 [23 .B -a24 .I addr25 ]26 .B write27 [28 .B -l29 ]30 .I path31 .br32 .B 9p33 [34 .B -a35 .I addr36 ]37 .B writefd38 .I path39 .PP40 .B 9p41 [42 .B -a43 .I addr44 ]45 .B stat46 .I path47 .PP48 .B 9p49 .B rdwr50 .I path51 .SH DESCRIPTION52 .I 9p53 is a trivial 9P client that can access a single file on a 9P server.54 It can be useful for manual interaction with a 9P server or for55 accessing simple 9P services from within shell scripts.56 .PP57 The first argument is a command, one of:58 .TP59 .B read60 print the contents of61 .I path62 to standard output63 .TP64 .B write65 write data on standard input to66 .IR path ;67 the68 .B -l69 option causes70 .I write71 to write one line at a time72 .TP73 .BR readfd ", " writefd74 like75 .B read76 and77 .B write78 but use79 .IR openfd (9p)80 instead of81 .IR open ;82 this masks errors and is mainly useful for debugging83 the implementation of84 .I openfd85 .TP86 .B stat87 execute88 .I stat (9p)89 on90 .I path91 and print the result92 .TP93 .B rdwr94 Open95 .I path96 for reading and writing.97 Then repeat until end-of-file on standard input:98 copy a line from the file to standard output,99 copy a line from standard input to the file.100 Print errors, but don't give up.101 .B Rdwr102 is useful for interacting with servers like103 .IR factotum (4).104 .PD105 .PP106 .I 9p107 dials108 .I address109 to connect to the 9P server.110 If the111 .B -a112 option is not given,113 .I 9p114 requires the115 .I path116 to be of the form117 .IB service / subpath \fR;118 it connects to the Unix domain socket119 .I service120 in the name space directory121 (see122 .IR intro (4))123 and then accesses124 .IR subpath .125 .SH EXAMPLE126 To update127 .IR plumber (4)'s128 copy of your plumbing rules after editing129 .BR $HOME/lib/plumbing :130 .IP131 .EX132 cat $HOME/lib/plumbing | 9p write plumb/rules133 .EE134 .PP135 To display the contents of the current136 .IR acme (4)137 window:138 .IP139 .EX140 9p read acme/$winid/body141 .EE142 .SH SOURCE143 .B \*9/src/cmd/9p.c144 .SH SEE ALSO145 .IR intro (4),146 .IR intro (9p),147 .IR 9pclient (3)