I have a rather peculiar file format to work with:
Every line begins with the checksum of its content, followed by a new-line-character.
It looks like this:
[CHECKSUM OF LINE_1][LINE_1]\n
[CHECKSUM OF LINE_2][LINE_2]\n
[CHECKSUM OF LINE_3][LINE_3]\n
I didn't exactly check how it works but the reason seems to be quite simple.
In this case you don't need to override read/write/etc because you can use original ones.
In your case you have two possible solutions:
open, that make a copy of your file with striped checksums.
closethat calculates checksums and override original file
writethat are able to skip/calculate checksums.
fread() is part of the C library, and provides buffered reads. It is usually implemented by calling read() in order to fill its buffer
In this case I believe that overriding
close will be less error prone because you can safely reuse original