Chapter11 - Chapter 11: File Systems and Data is stored on...

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: Chapter 11: File Systems and Data is stored on magnetic and optical disks in Data Directories Directories files, named collections which are, in turn, grouped files named together into directories. directories To distinguish the To types of data being stored in different files, the names of files are suffixed with an identifying file extension. extension Chapter 11 File Systems File and Directories and Page 1 Page File Access File There are two major ways in which files are There organized and accessed. organized Sequential Access Direct Access The records in the file are The organized as a list and are retrieved and processed one at a time from the beginning to the end of the file. of The records in the file are The arranged so an individual record may be retrieved without examining other records in the file. file. Chapter 11 File Systems File and Directories and Page 2 Page Sequential File Access Sequential With sequential access, records are retrieved by With starting at the beginning of the file and extracting them in the order in which they exist within the file. them An example of this is the An common input file (cin) in (cin in C++, which uses the input operator (>>) to access operator to the next available piece of keyboard-generated data. keyboard-generated Advantages •Easy to program •Allows simple file structures •Well suited to many common Well programming applications (pattern searches, small files, rarely processed files) rarely Disadvantage •Poor access performance Chapter 11 File Systems File and Directories and Page 3 Page Indexed Files Indexed To implement direct access in file organization, To an indexed directory is often stored in memory. an This directory is basically a table consisting of some This aspect of each record (called a key) and the key and corresponding record’s location within the file. corresponding Name Sector Track SSN Sector Track Adams 5 68 5 43 Bosley 4 27 Carter 5 43 40223116 1 62788001 3 75930756 2 3 71 4 11 Chapter 11 File Systems File and Directories and Page 4 Page Hashed Files Hashed To provide direct access to the records in a file To without the overhead of an indexed directory, hashing is a viable alternative. hashing With hashing, one of the With record’s key fields is used to map the record to a particular section (or “bucket”) in the memory device. memory If the hashing function is If strategically chosen, then the buckets will be relatively balanced and efficiency will be enhanced. enhanced. Chapter 11 File Systems File and Directories and Page 5 Page Directories Directories To organize files within a computer system, To hierarchical directories are usually implemented. hierarchical This traditional This approach to file organization is known as the “folder metaphor” since it is analogous to the organization of paper file folders. folders. Chapter 11 File Systems File and Directories and Page 6 Page Disk Scheduling Disk Accessing secondary Accessing memory is one of the most time-consuming aspects of processing, so a primary goal is to ensure that such access is handled as efficiently as possible. efficiently The most common approach is to have the read-write The heads move towards the shaft, reading all requested sectors of all requested tracks as each successive cylinder is reached. is Once the shaft is reached, the read-write heads move away Once from the shaft, reading all requested sector/track combinations until the outer platter edge is reached, whereupon the entire process is repeated. whereupon Chapter 11 File Systems File and Directories and Page 7 Page ...
View Full Document

This note was uploaded on 08/26/2009 for the course CS 111 taught by Professor Klein,s during the Fall '08 term at Southern Illinois University Edwardsville.

Ask a homework question - tutors are online