Total Pageviews

February 15, 2012

Adding and deleting the records on a serial file


If one or more records has to be added to a serial file, there is no problem, and the new records can simply be appended to the end of the file.
Deleting a record is more complex. It is easy to understand the problem if we imagine the file is held on magnetic tape, and understand that in any particular program run you can either read from the tape or write to the tape. To find the record to be deleted, the computer has to read the tape form the beginning; but once it has found it, it cannot backup and ‘wipe’ just at that portion of the tape occupied by the record, leaving a blank space. The technique therefore is to create a brand new tape, copying over all the records up to the one to be deleted, leaving that one off the new tape and then copying over all the rest of the records.

No comments:

Post a Comment