Learning toolsProgress & bookmarks
p. 230
4 - 2 File Access Methods
An access method is a method for reading the records stored in a file and writing records to a file.
(1) Sequential access
Sequential access is a method for accessing records in order from the start of a file. It can only read records from a file from the beginning of the file in order. Therefore, it is a good method for reading and processing all records in order from the top of the file, but it is not suitable for processing from a specific record in the middle of a file. When it writes records to a file, it appends the records after the last record in order (if there are no records already present, it writes in order from the top), so there is no wasted area. This means that it is efficient for recording, but to insert a record in the middle of a file, it is necessary to remake the file.
(2) Direct access (random access)
Direct access (random access) is a method that directly accesses a specific record independent of the order of the records in a file. It is suitable for processing (i.e., reading or writing) on a specific record, but is not suitable for the processing of all records.
(3) Dynamic access
Dynamic access is an access method that combines direct access and sequential access. This is explained here with the example of the creation of a list of names beginning with “s.” The method for reading and writing records will be to first perform direct access to records with names beginning with “s”, and then perform sequential access for the subsequent records. Dynamic access enables the simultaneous use of these two access methods.
p. 231
Section progress
Original chapter exercises
Original chapter exercises →New FE Textbook Vol.1 · IT Fundamentals · First Edition, April 2015
