[Haskell-cafe] runInteractiveProcess and hGetLine on Windows
Duncan Coutts
duncan.coutts at worc.ox.ac.uk
Wed May 7 16:17:09 EDT 2008
On Wed, 2008-05-07 at 08:33 -0700, Bryan O'Sullivan wrote:
> David Roundy wrote:
>
> > This is the correct behavior (although it's debatable whether kpsewhich
> > should be outputting in text mode).
>
> I think it would be more accurate to say that runInteractiveProcess has
> an inadequate API, since you can't indicate whether the interaction with
> the other process should happen in text or binary mode.
>
> Simon: do the new entry points in System.Process take line ending
> conventions into account?
It doesn't require any new api:
(inh,outh,errh,pid) <- runInteractiveProcess path args Nothing Nothing
-- We want to process the output as text.
hSetBinaryMode outh False
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'.
Duncan
More information about the Haskell-Cafe
mailing list