Modes of File Access

The computer file can be accessed in three modes:
sequential, random and dynamic.
1.Sequential Access
This means that for accessing a record sequentially, the file has to be read from the beginning, that is record 1, record 2, and so on until the required record is reached. The access time of a single record depends on where in the file the record is stored. That is, if it is the first record in the file, it takes much less time to access than a record that is at the end of the file.
2.Random Access
This method takes the same time for accessing the record in the file wherever the record is physically located in the file. The storage location of the record is obtained by converting the key value of the record into its numeric location address by hash function. Then the record is located directly.
3.Dynamic Access
This mode combines both sequential and random modes of access. At times, it may be required to start sequential access from a given record only. For example a file holds 2000 records and records numbered 1220 to 1250 are to be accessed for processing. In this case, it is better to locate the record number 1229 randomly and access the remaining records in sequential mode.

Comments