Re: How To Redirect STDERR to /dev/null programmatically



On Fri, Aug 27, 2004 at 08:03:34PM +0530, Harsha Kodnad wrote:
    Anybody please tell me how to direct my application's STDERR to /dev/null programmatically. in a C 
program.

freopen("/dev/null", "w", stderr);

    I want to inhibit all warnings or errors generated by my application or shared libraries I am using by 
doing this at my program initialization.

If we are talking about Gtk+, GLib, etc., you can also set
up a log handler for their messages with g_log_set_handler()
that doesn't actually print anything anywhere.

Yeti


--
Do not use tab characters. Their effect is not predictable.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]