[Haskell-cafe] Re: Execution of external command

Simon Marlow simonmarhaskell at gmail.com
Thu Dec 13 10:54:22 EST 2007


Bulat Ziganshin wrote:
> Hello Duncan,
> 
> Thursday, December 13, 2007, 4:43:17 PM, you wrote:
> 
>> Use just the GHC bit from the code I pointed at:
> 
> thank you, Duncan. are there any objections against simplest code
> proposed by Yitzchak? i.e.
> 
> (_, h, _, _) <- runInteractiveCommand "script params"
> output <- hGetContents h
> 
> taking into account that bad-behaved scripts are not my headache?

It could deadlock if the script produces enough stderr to fill up its pipe 
buffer, because the script will stop waiting for your program to empty the 
pipe.

It's been said several times, but we should really have a higher-level 
abstraction over runInteractiveProcess.

Cheers,
	Simon


More information about the Haskell-Cafe mailing list