[Haskell-cafe] trying to understand runProcess handles

Donn Cave donn at drizzle.com
Fri Mar 3 12:05:49 EST 2006

On Thu, 2 Mar 2006, Matthias Fischmann wrote:
> The problem is that gnuplot terminates right away after it tries to
> read from stdin (I can see the shadow of a window appear and vanish
> immediately).  I tried setFdOption, with no effect.  Is this because
> the handles passed to runProcess are closed in the parent process, and
> therefore the pipe is teared down and useless?
> I don't think so: If I run 'find /' instead of gnuplot, the process
> happily starts and I can hGetLine from stdout.

That doesn't necessarily disprove your hypothesis, since "find" doesn't
read input.  You might try "tr" instead, for example.  I don't see
anything about what you were doing that would be obviously different
from runProcessInteractive, but as long as you're making a pipe for
error output, you may as well read it and see if gnuplot has left
any clue to its problem there.

	Donn Cave, donn at drizzle.com

More information about the Haskell-Cafe mailing list