[plug] OT - logger etc
Ryan
ryan at prodigital.net.au
Mon Dec 31 11:27:40 WST 2001
On Sun, Dec 30, 2001 at 06:25:01PM -0800, Wayne Vovil wrote:
> Hi
>
> A bit off topic (actuallu a lot). Has anyone out there got some C source code for doing logging to a file. I don't wish to use syslog or daemons. I know I should just write to a file with some simple code; but why reinvent the wheel.
>
> Wayne
> PS what I REALLY want is all of the following:
Just to clarify, I know you said no syslog, the second link i posted has:
In C-code:
fp_console = fopen("/dev/console","w")
if ( ! stat("filename",&stat_buf) )
/* normal action here */
else /* error output to console */
fprintf(fp_console,"Error: cannot open file");
near the top of it plus pros and cons etc, I'm assuming that is the kind of thing you were after.
Ryan
More information about the plug
mailing list