[Haskell-cafe] Execution of external command

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Dec 13 08:58:21 EST 2007


Hello gwern0,

Thursday, December 13, 2007, 4:43:02 PM, you wrote:

> to get at stdout. I don't think this would go through cmd/sh, but
> honestly, specifying a particular interpreter breaks your
> portability anyway

these scripts will be written by users so they don't need to be the
same for win&unix. i guess that users will prefer to use perl or
something like this for these scripts and afaiu in both windows and
linux this need to go through sh/cmd

it seems that script may be not terminated if its output isn't read, so
better code should be

(_, h, g, _) <- runInteractiveCommand "script params"
result <- hGetLine h
hGetContents h >>= evaluate.length
hGetContents g >>= evaluate.length

am i right?


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list