[Haskell-cafe] runInteractiveProcess and hGetLine on Windows

Harri Kiiskinen harri.kiiskinen at utu.fi
Wed May 7 10:42:45 EDT 2008


Hello all,

I bumped into a "feature" which might be a bug, but to be certain, I'd
like to hear your opinion. I'm running ghc 6.8.2 on Windows XP, and with
ghci I do the following:

Prelude System.Process System.IO> (inp,outp,err,ph) <-
	runInteractiveProcess "kpsewhich" ["testfile.txt"] Nothing
		Nothing

('kpsewhich' is a simple path searching utility used by web2c TeX
system, returns the full path to the file if found in the system defined
search path, but you all probably know that.)

and then:

Prelude System.Process System.IO> hGetLine outp

which gives me:

"./testfile.txt\r"

as opposed to "./testfile.txt" which I get on my Linux box.

Is the "\r" supposed to be at the end? I thought it is part of the line
separator in Windows, and as such, should not be part of the line
retrieved? Same thing happens when compiled with ghc.

Best Wishes,

Harri K.



More information about the Haskell-Cafe mailing list