fp = fopen("log.log","w");
/* ..... */
fflush(fp);
if ((log_siz) < ftell(fp))
{
rename("log.log","log.log2");
freopen("log.log","w", fp);
}
fprintf(fp, "456");
/* ..... */
fclose(fp);
fp = fopen("log.log","w");
/* ..... */
fflush(fp);
if ((log_siz) < ftell(fp))
{
rename("log.log","log.log2");
freopen("log.log","w", fp);
}
fprintf(fp, "456");
/* ..... */
fclose(fp);