News for hackers. Stuff that matters.
Re:Rust RAII is better than the Haskell bracket pattern by radarsat1 on Tuesday October 09, 2018 @07:02AM (#18174873)
How do you properly handle an error on fclose in C?
Re:Rust RAII is better than the Haskell bracket pattern by vbezhenar on Tuesday October 09, 2018 @07:37AM (#18175032)
At 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.
Re:Rust RAII is better than the Haskell bracket pattern by cesarb on Tuesday October 09, 2018 @08:10AM (#18175225)
The 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.