Random access files are essential for many

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ach application program must include its own code to interpret an input file into the appropriate structure. This type of file structure is used in two of the most popular operating systems, UNIX and MS-DOS. Files as Sequence of Fixed-Length Records As shown in Figure 14.16(b), in this case the operating system treats a file as a sequence of fixed-length records. Each record has some internal structure defined by the creator of the file. In this case all file access operations at operating system level deal with the number of records to be read, written or skipped. This type of file structure was commonly used in olden days operating systems. For example, when the 80-column punched paper cards were popular as input media, and 132 column printers were popular as output device, many operating systems based their file systems on input files consisting of 80-character records and output files consisting of 132-charaeter records. The most recent operating system that used this type of file structuring scheme was CP/M. File Access Methods To use the information stored in a file, it must be accessed and read into computer memory. The two commonly supported file access methods at operating system level are sequential and random access. They are briefly described below. 1. Sequential Access Files. Sequential access files are normally used with sequential access storage media such as magnetic tape. Information stored in a sequential access file can be accessed only sequentially. That is, a process can read the bytes or records in the file in the order in which they are stored, starting at the beginning. Reading of bytes or records randomly or out of order is not possible. A sequential file can, however, be rewound and read as often as needed. 2. Random Access Files. Random access files are normally used with random access storage media such as magnetic or optical disks. Unlike a sequential access file, information stored in a random access file can be accessed randomly irrespective...
View Full Document

Ask a homework question - tutors are online