C stdio trickery for read/write mode