Hello List

My app consists of a GUI process, a daemon and a number of worker processes. Each of these processes has their stderr redirected via freopen() to the same log file.
For the purposes of simple logging this arrangement works acceptably.
There is a thread on why this should be: 
http://www.cocoabuilder.com/archive/message/cocoa/2003/6/16/3689

The user may however delete the shared log from the GUI.
After this the daemon and worker process log output is lost.
In those cases can I detect that the stderr stream is no longer valid?

I have tried fcntl(), fileno(), fstat(), ftell() and feof() without success.

My actual call to NSLog() is wrapped in a generic logging class.
My only solution so far is to issue freopen(logfile, "a", stderr) prior to each and every call to NSLog().
But this seems brutal.

Jonathan
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to