Hi Ernesto,

import System.Process (readProcessWithExitCode)

I'm using this for capturing stdout directly:
  (code,output,error) <- readProcessWithExitCode binName (args) []

Or when I want to capture the file generated by binName, I set the filename to stdout explicitly:
  (code,output,error) <- readProcessWithExitCode binName (args ++ ["/dev/stdout"]) []


Hope it helps,

vlatko

-------- Original Message --------
Subject: [Haskell-cafe] Standard output of exec
From: Ernesto Rodriguez <neto@netowork.me>
To: Haskell Cafe <haskell-cafe@haskell.org>
Date: 11.12.2014 10:11


Dear All,

I have a program which invokes an external program via exec. I wish to capture the standard output of the program without using external (temporary) files. Is it possible to create an in memory handle which I can tell exec to use as standard output of the invoked program. It would be great if it can be done without any extra dependencies.

Best,

--
Ernesto Rodriguez

Masters Student
Computer Science
Utrecht University





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