system-posix-redirect

A toy module to temporarily redirect a program's stdout.

LTS Haskell 10.10:1.1.0.1
Stackage Nightly 2018-03-10:1.1.0.1
Latest on Hackage:1.1.0.1

See all snapshots system-posix-redirect appears in

BSD-3-Clause licensed by Galois Inc., Liyang HU
This version can be pinned in stack with:system-posix-redirect-1.1.0.1@sha256:df83896f3567bc0e1d24f3f76f97d1d43857679b1c4f67eb303bb93b9eacd621,1354

Module documentation for 1.1.0.1

Depends on 3 packages(full list with versions):

Due to the design of POSIX, it is possible to temporarily overload the file descriptors corresponding to stdout and stderr to point to an arbitrary pipe. It is, however, tricky to get right. This module gets it right, as far as such a terrible hack can be made right. It can be used to make misbehaving third-party C libraries stop spewing to standard output. Warning: the module author has concluded that due to lack of portability, this module should not be used in any serious sytem. But, for those who like living dangerously...