hi ghc-friends,
i try the following code, but it don't work:
import System.Process
import Control.Concurrent
import System.IO
p = threadDelay 10000000
main3 = do putStrLn "test"
hClose stdin
(inp, out, err, pid) <-
runInteractiveProcess "Test.exe" [] Nothing Nothing
p
forkIO (putStrLn =<<
hGetContents out)
forkIO (putStrLn =<<
hGetContents err)
p
putStrLn "inp"
forkIO (hPutStrLn inp "in" >>
hClose
inp)
p
forkIO (putStrLn =<<
hGetContents out)
forkIO (putStrLn =<<
hGetContents err)
putStrLn "out"
threadDelay 1000000
forkIO (hPutStrLn inp "quit" >>
hClose
inp)
hShow out
return ()
thanks for helping.
Logged In: YES
user_id=48280
Please could you give more information: we don't know what
"Test.exe" is. What do you expect to happen, and what in
fact does happen? What behaviour are you claiming is at fault?
Logged In: YES
user_id=1376599
Sorry ... we working on so many problems and now it's
time for the GHC-Answer :).
Ok, we have one executable program we wants to start and
after the start we give him one parameter which is a string.
The executable file is a chess engine.
Communication is like:
"e2e4"
then we waiting for response ...
and the engine sais:
"c7c5"
this is our thread. But the code doesn't work. The
engine was started but not the communication.
thanks alot.