On 14 Feb 2003 22:45:05 -0000
[EMAIL PROTECTED] wrote:

> 
> To let vpopmail read a config file is nothing
> but waste....
> 
> =d0Mi=
> 
example program to get server name,user, and passwd.

#include <stdio.h>
#include <string.h>

char server[20];
char user[20];
char passwd[20];

int main(void )
{

FILE *fd;
char data[100];

if((fd=fopen("/tmp/test.conf","r"))==NULL) {
    printf("file tidak bisa dibuka\n");
    exit(1);
    }
fgets(data,sizeof(data),fd);
strcpy(server,data);
strtok(server,"\n");
//printf("server = %s\n",server);
fgets(data,sizeof(data),fd);
strcpy(user,data);
strtok(user,"\n");
//printf("username = %s\n",user);
fgets(data,sizeof(data),fd);
strcpy(passwd,data);
strtok(passwd,"\n");
//printf("passwd = %s\n",passwd);
fclose(fd);
}

[onOs@shadow tmp]$ time ./test

real    0m0.002s
user    0m0.000s
sys     0m0.002s

/dev/hda:
 Timing buffer-cache reads:   128 MB in  0.91 seconds =141.25 MB/sec
 Timing buffered disk reads:  64 MB in  3.19 seconds = 20.07 MB/sec


why waste ??
running simple program like that only use resources 0.002 s
that mean every 500 message had lost delay 1 s
and my hardisk only use QUANTUM FIREBALLlct20 20, ATA DISK drive
how abaut SCSI IBM with 160 MB/s ??
it is not "usefull" ?


-- 
thx
onOs

Reply via email to