Set file position to start before flushing buffer