Hacker News new | ask | show | jobs
by elFarto 1835 days ago
Interesting. I've always wondered why there wasn't an addition in/out fd pair for communicating with the previous/next program in a chain of pipe, e.g:

  foo     |  bar
  STDOUT --> STDIN
  ALTIN  <-- ALTOUT
You could detected it by looking for specially number fd's open on program launch, or maybe an environment variable.
1 comments

It would make pipes, the shell, and troubleshooting programs an order of magnitude more complex.

What is you want to inspect the ALT flow? How do you code logic that concurrently reads and writes data without blocking, deadlocks or decent performance? What's the terminating condition? And is it necessary at all? Pipes describe transformation of data, bidirectional pipes imply the transformation of the agent/process itself, not only the data, which flows in one direction.

Make it two orders of magnitude more complex.

I mean, it's possible, but unidirectional pipes are much easier to grok and pretty excellent already.