Dale - Computer Science Illuminated 382

Dale - Computer Science Illuminated 382 - stored. The most...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sequential file access The technique in which data in a file is accessed in a linear fashion Direct file access The technique in which data in a file is accessed directly, by specifying logical record numbers 11.1 File Systems 355 Figure 11.2 Sequential file access Beginning Current file pointer Rewind Read or write End Figure 11.3 Direct file access Current file pointer 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 . .. Jump to any logical record then read or write Let’s examine the two primary access techniques: sequential access and direct access. The differences between these two techniques are analogous to the differences between the sequential nature of magnetic tape and the direct access of a magnetic disk, as discussed in Chapter 5. However, both types of files can be stored on either type of medium. File access techniques define the ways that the current file pointer can be repositioned. They are independent of the physical restrictions of the devices on which the file is
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: stored. The most common access technique, and the simplest to implement, is sequential access , which views the file as a linear structure. It requires that the information in the file be processed in order. Read and write oper-ations move the current file pointer according to the amount of data that is read or written. Some systems allow the file pointer to be reset to the beginning of the file and/or to skip forwards or backwards a certain number of records. See Figure 11.2. Files with direct access are conceptually divided into numbered logical records. Direct access allows the user to set the file pointer to any partic-ular record by specifying the record number. Therefore, the user can read and write records in any particular order desired, as shown in Figure 11.3....
View Full Document

Ask a homework question - tutors are online