File Access Mechanisms

File access mechanism refers to the manner in which the records of a file may be accessed. There are several ways to access files

  • Sequential access
  • Direct/Random access
  • Indexed sequential access

Sequential access

A sequential access is that in which the records are accessed in some sequence i.e the information in the file is processed in order, one record after the other. This access method is the most primitive one. Example: Compilers usually access files in this fashion.

Direct/Random access

  • Random access file organization provides, accessing the records directly.
  • Each record has its own address on the file with by the help of which it can be directly accessed for reading or writing.
  • The records need not be in any sequence within the file and they need not be in adjacent locations on the storage medium.

Indexed sequential access

  • This mechanism is built up on base of sequential access.
  • An index is created for each file which contains pointers to various blocks.
  • Index is searched sequentially and its pointer is used to access the file directly.

results matching ""

    No results matching ""