When it is necessary to do the file REWRITE of the record, the file should first be opened, and then the record must be read from the file. Only after these two steps should the file be closed. Because of this, the file should consistently be opened using the I/O mode.