file::reopen uses rewind when the modes match