Why is fseek or fflush always required between reading and writing in the update modes?

The library buffers input and output operations. Check out setvbuf() and the _IOFBF, _IOLBF parameters to that function. fseek() or fflush() require the library to commit buffered operations. The standard specifies a seek or flush operation (flushing the buffers) as mandatory prior to changing I/O direction to allow the library some shortcuts. Without this restriction, … Read more