On Thu, Jul 27, 2006 at 10:22:30PM -0600, Andrew McNabb wrote: > That makes a lot of sense, but I still don't completely get it. > > On Thu, Jul 27, 2006 at 10:07:57PM -0600, Byron Clark wrote: > > > > It appears that you can't open a pipe for reading unless it's been > > opened for writing already. > > It would seem that the "best" way to write this would be: > > nc -v www.mcnabbs.org 80 >$FIFO2 <$FIFO1 & > ./httpget.sh >$FIFO1 <$FIFO2 > > since each command opens a fifo for writing as quickly as possible and > waits as long as possible before opening a fifo for reading. > > However, it seems to hang when I do it this way. What am I missing?
Sorry, that was a mistake in the explanation. open(2) for reading _or_ writing on a pipe will block until open(2) is called on the other end of the pipe. So, the only thing that matters is that you open the pipes in the same order for both commands. -- Byron Clark
signature.asc
Description: Digital signature
/* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
