
14 Sep
2008
14 Sep
'08
9:52 p.m.
marcot:
Em Dom, 2008-09-14 às 16:07 -0300, Marco Túlio Gontijo e Silva escreveu:
Thanks, I got it to work running
threadWaitRead stdInput
before getChar.
Now I've got another problem:
import Control.Concurrent import System.IO import System.Process
main :: IO () main = do process <- runCommand "wget http://ftp.br.debian.org/debian/pool/main/g/ghc6/ghc6_6.8.2-6_amd64.deb" forkIO $ putStrLn "fork" >> getChar >>= putChar >> terminateProcess process waitForProcess process return ()
Not even fork is shown. Any hints?
Daemonic threads. When the main thread exits, everything exits. Check the docs for Control.Concurrent. You better use an MVar to ensure the main thread waits on its child. -- Don