This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Chapter 11: File Systems and
Data is stored on magnetic and optical disks in
Directories files, named collections which are, in turn, grouped
together into directories.
To distinguish the
types of data
being stored in
different files, the
names of files are
suffixed with an
Page File Access
There are two major ways in which files are
organized and accessed.
Sequential Access Direct Access The records in the file are
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
arranged so an individual record
may be retrieved without
examining other records in the
file. Chapter 11
Page Sequential File Access
With sequential access, records are retrieved by
starting at the beginning of the file and extracting
them in the order in which they exist within the file.
An example of this is the
common input file (cin) in
C++, which uses the input
operator (>>) to access
the next available piece of
•Easy to program
•Allows simple file structures
•Well suited to many common
(pattern searches, small files,
rarely processed files)
•Poor access performance Chapter 11
Page Indexed Files
To implement direct access in file organization,
an indexed directory is often stored in memory.
This directory is basically a table consisting of some
aspect of each record (called a key) and the
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
2 3 71 4 11 Chapter 11
Page Hashed Files
Hashed To provide direct access to the records in a file
without the overhead of an indexed directory,
hashing is a viable alternative.
With hashing, one of the
record’s key fields is used to
map the record to a particular
section (or “bucket”) in the
If the hashing function is
strategically chosen, then the
buckets will be relatively
balanced and efficiency will be
Directories To organize files within a computer system,
hierarchical directories are usually implemented.
hierarchical This traditional
approach to file
known as the
it is analogous to
of paper file
folders. Chapter 11
Page Disk Scheduling
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.
The most common approach is to have the read-write
heads move towards the shaft, reading all requested
sectors of all requested tracks as each successive cylinder
Once the shaft is reached, the read-write heads move away
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
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.
- Fall '08
- Computer Science