#include <stdio.h>
#include <sys/stat.h>
void main()
{ FILE *fp = fopen("./somefile.txt", "w");
int size = 0;
struct stat sfile;
size += fprintf(fp, "Some data %d", anint);
size += fprintf(fp, "More data to add to the file\n");
fclose(fp);
if( ( stat("./somefile.txt", &sfile ) ) == -1 )
{ //error here. The file wasn't even created.
}
if( sfile.st_size < size )
{ //Not all the file was written, error here too
}
}
the issue is that when editing helpfiles, they seem to write over
the afile for the area I'm in, causing in a crash and loss of the area
in the next copyover. Where do I go to fix what to make this not happen?