3 ms·
How do you properly handle an error on fclose in C?
by radarsat1 8y ago
How do you properly handle an error on fclose in C?
- vbezhenar 8y agoAt least without pretending that everything's OK. Report to user and abort process would be appropriate for many cases. Continuing work with half-written data without ever noticing it is not appropriate.
- cesarb 8y agoThe same way you would handle an error on fwrite() or fflush(). Any of them failing means that the data wasn't written correctly; what to do with that depends on the program.