From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <3.0.5.32.20000801204034.007cfe40@mail.real.com> Date: Tue, 1 Aug 2000 20:40:34 -0700 To: 9fans@cse.psu.edu From: Skip Tavakkolian Subject: Re: [9fans] pipefile In-Reply-To: <200007310115.VAA03125@cse.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Topicbox-Message-UUID: f1e49ae0-eac8-11e9-9e20-41e7f4b1d025 Could one stack pipefiles? Also, this may be a totally stupid question, but I am wondering why there never was a notation for bidirectional pipes in the shell (say '><') that sets this pipelining? So, your example would look like: rc >< readwrite /dev/cons It does look to be of limited use. At 09:14 PM 7/30/00 -0400, rob pike wrote: >> If you don't mind, could you also say a word as to what made the >> /dev/cons case special? Who was writing to /dev/cons all of the >> keyboard input so that it worked? (rio?) > >/dev/cons is connected to standard in and standard out, that's all. >I stupidly had file descriptors 0 and 1 wired into the code. >Nobody was writing any keyboard input of any kind to /dev/cons. > >What pipefile does is place filters between the file and >any subsequent program that opens it for i/o, by binding a pipe >onto the file and then connecting the filters to the pipe. The other >end of the pipe is connected to the underlying file. > >Normally you have, in effect, > > /dev/cons > >but after > > pipefile -r 'readcmd' -w 'writecmd' /dev/cons > rc < /dev/cons >/dev/cons > >you have, almost literally, > > /dev/cons > >(The only difference is that it uses one full duplex pipe instead >of two half duplex ones.) > >What was special about /dev/cons was that I had this >example in mind when I wrote the program, so what >it actually did was closer to > > /fd/1 > >The fix was to open the file explicitly. > >Hope that helps. > >-rob > >