MECH 2301 Lecture Notes - Lecture 22: Data File, Access Method, Sequential Access
MECH 2301 Lecture 22 Notes
Introduction
Sequential File Access
• To an extent, however, the access method used affects the ways in which the file may
be stored physically.
• For example, a file in which variable-sized records must be accessed in random order is
not conveniently stored on tape
• Where the system must wind from the beginning of the tape to find the desired record
• An overview of file access methods will serve to pinpoint the requirements of physical
file storage.
• Nearly every file management system supports sequential file access.
• Files that are accessed sequentially represent the great majority of all files.
• Sequential files include programs in source and binary form, text files, and many data
files. Information in a sequential file is simply processed in order of storage.
• If the file is record-oriented, records are processed as they are stored.
• A file pointer maintains the current position in the file.
• For read operations, the data is read into a buffer, and the pointer is moved forward
into position for the next read.
• For write operations, the new data is appended to the end of the file.
• The pointer always points to the end.
• Most systems allow resetting the pointer to the beginning of the file.
• This operation is often referred to as rewind, because of its similarity to a tape
operation.
• Some systems also allow the pointer to be moved a fixed amount.
• This operation is sometimes called seek.
• Sequential access is based on a tape model, since files on tape can only be read
sequentially.
find more resources at oneclass.com
find more resources at oneclass.com