If calling the fread () function returns 0 and ferror () indicates an error (against EOF), is it ok to repeat the reading or is it better to close and open the file again?
I can’t start completely - the input file was partially processed in a way that cannot be undone (for example, I write a fragment at a time to the socket and, by virtue of the existing protocol, are not able to tell the remote end, "it doesn’t matter, I need to start all over again") .
I can fclose () and fopen () the file, fseek () past the already processed data and continue fread () - from there, but is all this necessary?
source
share