1. 源码
#include <stdio.h>
#include <tcl.h>
#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <atmi.h>
#include <userlog.h>
#include <time.h>
#include <stdarg.h>
extern "C" {
int Tuxedotcl_Init(Tcl_Interp *Interp);
}
/***********************************************************
** Function Name : write_log
** DESC: write log by format.
** FUNC:
** ARGS: the format like the format of 'printf'.
** RTN : int
** NOTE:
**
** DATE AUTHOR ACTION
** 20120524 Wang yaofu Modify
**
************************************************************/
int write_log( char *format, ... )
{
time_t timeval;
struct tm *tmval;
char sDate[9];
char sTime[9];
char logdirf[32], formatBuf[1024], logHead[20];
va_list mark;
int fd;
timeval = time (0);
tmval = localtime(&timeval);
sprintf(s