- FILE * file = fopen(recordfile_tmp, "a");
- exit_err(0 == file, world, err_open);
- exit_err(write_uint8(action, file), world, err_write);
- exit_err(fclose(file), world, err_close);
+ FILE * file_old = fopen(recordfile, "r");
+ FILE * file_new = fopen(recordfile_tmp, "w");
+ exit_err(0 == file_old, world, err_open);
+ char c = fgetc(file_old);
+ while (EOF != c)
+ {
+ exit_err(write_uint8(c, file_new), world, err_write);
+ c = fgetc(file_old);
+ }
+ exit_err(fclose(file_old), world, err_close);
+ exit_err(write_uint8(action, file_new), world, err_write);
+ err_close = "Trouble in turn_over() with fclose() "
+ "closing opened file 'record_tmp'.";
+ exit_err(fclose(file_new), world, err_close);