
On UNIX, we can easily redirect stdout to /dev/null in a Shell. How is this realized in Haskell on both UNIX and Windows? I used a library which gave me unwanted stdout display. I tried to find any function to hide the stdout output, but could not. Can someone help me out? Otherwise I have to modify the code in the library to comment out some print commands. Thanks, Hong

On Sat, Oct 03, 2009 at 04:43:25PM -0500, Hong Yang wrote:
On UNIX, we can easily redirect stdout to /dev/null in a Shell. How is this realized in Haskell on both UNIX and Windows?
I'm not sure about Windows, but in Unix you'd close stdout, open /dev/null and then call dup2() (System.Posix.IO.dupTo) to duplicate the newly opened Fd to stdout (1).
I used a library which gave me unwanted stdout display. I tried to find any function to hide the stdout output, but could not. Can someone help me out?
Otherwise I have to modify the code in the library to comment out some print commands.
I would strongly encourage you to modify the library. It can be argued that it's rather poor library design to not let the user control where output goes. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe
participants (2)
-
Hong Yang
-
Magnus Therning