[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The primitiveness of pipe



I understand that new feature requests are particularly unwelcome at
this time, but I just can't resist...

I think someone mentioned the idea of making system calls available
via some general mechanism, and dynamically loadable modules have been
talked about.  In the absence of those things there is one system call
I would dearly have loved to have direct access to:  Namely pipe(2).
Imagine we had such a primitive, let's call it $&pipe2 so we don't
confuse it with the current pipe primitive.  pipe2 would open a pipe
and return the two resulting file descriptors.  It would also do the
necessary internal book-keeping for the file descriptors.

Then we should be able to rewrite %pipe in terms of $&pipe2 and
$&background, at least in principle.  We may or may not want to do so.

But we could also do all sorts of things you can usually not do in
other shells, like open a file descriptor in the current shell which
is a pipe into (or from) a process running in the background.

Just an idea.  Let it simmer on the back burner.  It doesn't worry me
if it has to wait until after v.1.0.

- Harald