Hi. I want to write a little haskell program executing about 4 programs
passing data via pipes. As my python script seems to be slower than a
bash script I want to try a ghc executable now.
It should invoke different parts of a text to speech chain. This way I
have one interface then.

Talar und #haskell told me that I might use runProcess and pass handles
for stdin and out created by createPipe and fdToHandle.

So my simple test looks like this:


module Main where
import System.IO
import System.Posix.IO

main = do
  (fdIn,fdOut) <- createPipe
  let (iohIn, iohOut) = (fdToHandle fdIn, fdToHandle fdOut)
  hIn <- iohIn
  hOut <- iohOut
  hPutStr hIn "test"
  line <- hGetLine hOut
  print line -- should now print test having been piped through my pipe

but I get the error:
pipe2: <file descriptor: 3>: hPutStr: illegal operation (handle is not
open for writing)

And in current CVS docs in base.System.Process.hs it is said that
createPipe is no longer exported ?

I've also found this library:
http://www.haskell.org/communities/11-2005/html/report.html#processlib
which seems to do something similar but is meant to pipe haskell types
between different threads (? I haven't understood what's going on there
because I can't understand Russian ;-)
Is this of any help for me?

Greetings Marc
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to