Hi mgampkay!
Thank You, these were the problems with my programs.
Greetings,
Árpád
On Sun, 2011-11-13 at 22:57 +0800, mgampkay wrote:
(hin, hout, _, p) - runInteractiveProcess copierer [] Nothing
./twowaysubprocesscomm
twowaysubprocesscomm: fd:7: hGetLine: end of file
Hi all!
I have found a simple program on the web:
--code begin: copierer.hs
module Main (main)
where
main = interact id
--code end
I compiled it with
ghc -threaded --make copierer.hs
If i start it from a terminal,it behaves like the cat program without
arguments: simply copies the stdin to
(hin, hout, _, p) - runInteractiveProcess copierer [] Nothing
./twowaysubprocesscomm
twowaysubprocesscomm: fd:7: hGetLine: end of file
twowaysubprocesscomm: fd:6: hPutChar: resource vanished (Broken pipe)
Because you didn't give the right path to copierer.
And you should hSetBuffering in
As mentioned by the first person to follow up, you need to set
line buffering in the copier program. It's filling up its buffer
while you write small lines to it - unlike the test run at the
terminal prompt, where it's connected to a TTY device and therefore
behaved differently.
In a situation