[Haskell-cafe] How to Hijack stdin,err,out, thread safely?
magnus at therning.org
Tue Jun 30 19:04:35 UTC 2015
On Wed, Jul 01, 2015 at 03:27:46AM +0900, Hiromi ISHII wrote:
> I'm currently writing a web app to check the spec of input code
> usging QuickCheck.
> quickCheck* functions writes results to stderr & stdout, but I
> don't want them written to the app's original stdout/err.
> (I'm using SafeHaskell features to avoid malicious code executed,
> so don't worry about that :-))
> So I want to execute I/O action hijacking stdout/err in a thread-safe manner.
> For example, I need function like below:
> censorHandles :: IO a -> IO (a, String, String)
> censorHandles = ...
> withStd :: Handle -> Handle -> Handle -> IO a -> IO a
> withStd = ...
Just to make sure, you have set `chatty` to false and passed it to one
of the other QuickCheck runners, right?
I haven't used it myself, but I was under the impression that's how
one controls the use of stderr/stdout (well, at least stdout).
Magnus Therning OpenPGP: 0xAB4DFBA4
email: magnus at therning.org jabber: magnus at therning.org
twitter: magthe http://therning.org/magnus
Do not meddle in the affairs of Wizards, for they are subtle and quick
-- J.R.R Tolkien
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 163 bytes
Desc: not available
More information about the Haskell-Cafe