updatetime.c

wolfpaw4.0-release/source/betasrc/util/updatetime.c · 466 B

From the archive Wolfpaw4.0-Release.tgz

Download the archive   « Back to the archive contents

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>

void main ( void )
{
FILE *fp;
struct timeval now_time;
time_t current_time;
char *strtime;

gettimeofday( &now_time, NULL );
current_time = (time_t) now_time.tv_sec;
strtime=ctime(&current_time);

fp=fopen("../system/boot_time","w");
fprintf(fp,"%s",strtime);
fclose(fp);
exit(0);
}

Site Stats

Snippets: 1791
Codebases: 571