
On Mon, Jun 13, 2011 at 12:35 PM, Manfred Lotz
Hi all, I have two handles where I get stdout resp. stderr from a command output.
Is it possible to merge those two handles so that I get a new input handle in a way that data can be read from the new handle whenever it is available from either of the two original handles?
Does what you're doing strictly need to be a handle? One thing you could try is is using an IO Channel: http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Con... You can create the channel, then fork off two threads to pump messages from the handles into the channel, and then read the channel from your main thread. If it does need to be a Handle object, there is probably some GHC black-magic you can do, but I recommend against it if at all possible. You can ask for more details if you want. If you're using unix, there might be something you can do with the underlying unix file descriptors, but I don't know much about that. Antoine
-- Manfred
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners