e.g.: set pipe [open "|echo foo >bar" r]
rightly throws an error, because stdout is redirected in
a pipe opened for reading.
But: by the time it complains, the pipeline has already
been executed (with all it's sideeffects) or is still running
in the background and no channel is assigned, so these
processes of the pipe cannot be identified.
A solution to this would likely involve changing the
signature of TclCreatePipeline() (although it is
"unofficially exported for BLT").
One solution could be to add an integer "flags"
argument, similar to Tcl_OpenCommandChannel()
and pass along TCL_STDIN and/or TCL_STDOUT
depending on whether the pipe is opened for r,w or
both, doing the forbid-mechanics one level deeper
than where it is done now.
|