F
Frank Hung
Dear all,
I want to create file, of which name is [current date+".log"].
But i do not know how to do. My sample code is shown as bellow:
... sprintf(buf2,"%d/%d/%d %d:%d:%d",
tims->tm_mon+1,
tims->tm_mday,
tims->tm_year+1900,
tims->tm_hour,
tims->tm_min,
tims->tm_sec);
f=fopen(buf2,"a"); /* open log */->will create file "2003-10-27"
But i want to create file, "2003-10-27.log".
Can anyone teach me how to do?
I want to create file, of which name is [current date+".log"].
But i do not know how to do. My sample code is shown as bellow:
... sprintf(buf2,"%d/%d/%d %d:%d:%d",
tims->tm_mon+1,
tims->tm_mday,
tims->tm_year+1900,
tims->tm_hour,
tims->tm_min,
tims->tm_sec);
f=fopen(buf2,"a"); /* open log */->will create file "2003-10-27"
But i want to create file, "2003-10-27.log".
Can anyone teach me how to do?