[Asterisk-Users] asterisk logger - urgent!!!

Michael Collins mcollins at fcnetwork.biz
Sat Feb 11 16:33:53 MST 2006


Perhaps there's a happy medium: sprintf()?

I am curious to know if putting the output into a char array with
sprintf() (to preserve the output formatting) and then writing it with
write().  How much additional overhead would this take?  Hard to know
without trying it.

Is anyone in a position to write some test code that would do this and
report back the results?

-MC

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Kevin P.
Fleming
Sent: Saturday, February 11, 2006 7:39 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] asterisk logger - urgent!!!

Bob Goddard wrote:

> Using fopen/fputs to ONLY append to a file, is quite frankly, stupid.
> Change it to open/write and you will be able to trap via the write
> return code and errno.

Patches to fix bugs are most welcome. Given that these files are written
using fprintf (because they are using format strings and long lists of
arguments), using write will require allocating memory, building the
output there and then calling write(). Seems like an awful lot of work
to avoid a simple system administration failure.
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list