On Thu, 2007-12-13 at 17:08 +0300, Bulat Ziganshin wrote: > Hello Duncan, > > Thursday, December 13, 2007, 4:51:20 PM, you wrote: > > >> OK, I'll bite. What's wrong with runInteractiveCommand? > > > It requires threads because you have to pull from both the stdout and > > stderr to prevent blocking. You could do it with non-blocking reads but > > not without busy-waiting. > > may be this will be ok (with -threaded)?
No need for -threaded. > (_, stdout, stderr, _) <- runInteractiveCommand "script params" > forkIO (hGetContents stderr >>= evaluate.length) > result <- hGetLine stdout > hGetContents stdout >>= evaluate.length Yep, that'll work. > awkward, but still shorter than code from Cabal The Cabal code has to work with ghc-6.2 - 6.8, hugs, nhc98 and jhc. It cannot use threads. Duncan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe