[Haskell-cafe] Intercept stdin in Haskell
andrew.gibiansky at gmail.com
Sun Jan 5 17:46:07 UTC 2014
I need to do something strange and terrible in Haskell: intercept `stdin`.
In other words, I need to detect (in another thread, probably?) when my
running program is trying to read from `stdin`, and then feed it some data.
I know I can use `hDupTo` and other similar things to replace the stdin
handle with my own handle, and I know I could probably use `createPipe` or
similar from the `unix` package in order to write things to these handles,
but I have no idea how I might go about detecting that a handle is being
Any ideas? I've racked my brain and cannot come up with a way to do this. I
am using the GHC API elsewhere if that leads to any sort of crazy hackery
that might save the day.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe