
9.7.2 Reading and Searching a
Sequential File
Suppose student data of an engineering college is main-
tained in a file (say “stud.dat”)
Let us assume that on a particular day, the principal
of the school requires some information from the file
called stud.dat. Now, the obvious step is to read the
file to get the required information. The read operation
for a sequential file is explained below.
To read a sequential file, the system always starts at
the beginning of the file and the records are read one by
one till the required record is reached or end of the file
is encountered. The end of the file (EOF) indicates that
all the reco ...