File Access Methods in Operating System
File Access Methods in Operating System
Read
Discuss
Courses
Prerequisite – File Systems
When a file is used, information is read and accessed into computer memory and there
are several ways to access this information of the file. Some systems provide only one
access method for files. Other systems, such as those of IBM, support many access
methods, and choosing the right one for a particular application is a major design
problem.
There are three ways to access a file into a computer system: Sequential-Access,
Direct Access, Index sequential Method.
1. Sequential Access –
It is the simplest access method. Information in the file is processed in
order, one record after the other. This mode of access is by far the most
common; for example, editor and compiler usually access the file in this
fashion.
Read and write make up the bulk of the operation on a file. A read
operation -read next- read the next position of the file and automatically
advance a file pointer, which keeps track I/O location. Similarly, for the -
write next- append to the end of the file and advance to the newly written
material.
Key points:
Data is accessed one record right after another record in an order.
When we use read command, it move ahead pointer by one
When we use write command, it will allocate memory and move
the pointer to the end of the file
Such a method is reasonable for tape.