corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay!
corz.org text viewer..
[currently viewing: / public/ scripts/ c/ uptime/ uptime-AMIP-POST.c - raw]
int main(int argc) {
FILE * utInfo;
long sec; sec = 0;
if (argc > 1) {
printf("\n outputs the time since the peecee booted\n");
printf(" to a file, in curl POST format\n\n");
printf(" usage: uptime\n\n");
printf(" no additional arguments required!\n");
printf(" v0.1-amip (c) corz.org 2005 ->\n\n");
return 1;
}
sec = GetTickCount() / 1000;
utInfo = fopen ("uptime.nfo","wb");
if (utInfo != NULL) {
fprintf(utInfo, "-d \"uptime=%d\"\n", sec);
fclose (utInfo);
return 0;
} else {
fprintf(stderr, "couldn't open the file for writing");
return 1;
}
}