[Haskell-cafe] Re: Execution of external command

Donn Cave donn at drizzle.com
Thu Dec 13 14:22:49 EST 2007


On Thu, 13 Dec 2007, Duncan Coutts wrote:
...
> Something simple would be to allow attaching a pipe to just the stdout
> and redirecting stderr elsewhere, or connecting both stdout and stderr
> to the same output pipe. runProcess allows substituting any of
> stdin/stdout/stderr for other Handles and runInteractiveProcess
> substitutes them all for pipes. What we need is something in between
> that allows substituting some for given Handles and connecting others to
> pipes.

Right.  Even if there weren't this logistical problem when you
divert both stdout & stderr, it's not the right thing to do,
commonly enough to even make it a default, let alone the only way.

Maybe half the time, it would be better for stderr to go wherever
it has been going.  Maybe 2/3 of the remaining half would be
better served by stderr & stdout merged on the same stream
(which the caller might arrange with a shell redirection in
the command, "script params 2>&1".)

I imagine it would be easy enough to create the pipes to use with 
runProcess, but don't know how portable this would be outside the
UNIX / POSIX world.

	Donn Cave, donn at drizzle.com



More information about the Haskell-Cafe mailing list