From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200007310115.VAA03125@cse.psu.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] pipefile From: "rob pike" Date: Sun, 30 Jul 2000 21:14:55 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: ee673cce-eac8-11e9-9e20-41e7f4b1d025 > 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