[Haskell-cafe] runInteractiveProcess and hGetLine on Windows

Harri Kiiskinen harkiisk at utu.fi
Wed May 7 18:12:28 EDT 2008


Thank You all for the lively discussion, and of course, a nice and
simple answer to my problem:

On Wed, 2008-05-07 at 21:17 +0100, Duncan Coutts wrote:
> (inh,outh,errh,pid) <- runInteractiveProcess path args Nothing Nothing
> -- We want to process the output as text.
> hSetBinaryMode outh False

As to the following claim:

> As of a couple weeks ago the docs for runInteractiveProcess even say:
> 
> -- The 'Handle's are initially in binary mode; if you need them to be
> -- in text mode then use 'hSetBinaryMode'.

At least the haskell.org standard library reference does not say this
(http://haskell.org/ghc/docs/latest/html/libraries/process/System-Process.html), but the information can be found on the System.IO reference page.

As a general comment to this feature, I find it quite acceptable, as on
non-Windows systems it does no harm, and on Windows, you get the desired
behaviour. Seems to reflect closely the practice and distinction in C
(http://en.wikipedia.org/wiki/Newline), too.

Harri K.



More information about the Haskell-Cafe mailing list