File systems provide applications with permanent storage. More than that theyorg anize and protect
data, and provide a clean interface to allowmanipulation of that data. It’snoexaggeration to say that pro-
viding a file system is one of the major services of general purpose operating systems, and less general ones
as well. (Even the palm pilot has permanent storage).
Afile is a persistent, hardware-independent, named, protected collection of bits and a collection of
operations that can be executed on them. The access operations generally impose an order on the bits. The
attributes attributes define what files are used for.
Persistence implies that the bytes have a meaning that extends in time. Memory used in calculating
intermediate results doesn’
thav e that attribute. One wouldn’
tstore the memory used in a computation in a
file because it has no long-term use.
Because the data in files has this long term significance, files are
stored on more permanent media. These days, the most common medium is still magnetic disk, although
several others are making bids. Some other media that can contain files are memory
CD-ROMS, and more esoteric media.
Basically anything that can hold information permanently and be
read by a computer has held a file system, or will eventually.
By definition, files are largely medium-independent. The same operations are generally allowed on
files regardless of the underlying storage medium. There are obvious exceptions - you can write to a CD-
ROMatmost once, and there are obvious drawbacks to trying to move toabyte at the front of a tape to the
back. In general, however, code that manipulates files on one medium will work on others. This savesalot
of programmer time, as we’ll see.
,file systems provide a way to name files. This is a seemingly simple function that turns out
to be enormously powerful.
File systems provide ways to name files that span multiple media on the same
machine (the UNIX®file system), loosely connected local area networks (the Network File System (NFS))
and evenglobal name spaces (the AndrewFile System (AFS)). Providing a name space outside the con-
fines of memory addresses allows processes to share data and communicate.
Because files are outside memory
,theyare also outside the protection of the memory protection sys-
.Asaresult, the file system has to impose ideas of user identity and related privileges on the data.
The File Abstraction
Although the idea of an abstract, named collection of bytes is easy enough to grasp, the Devil is in
Despite the fairly simple idea of what a file is, files on different operating systems can be
remarkably different. We’ll discuss the variations in the file abstraction along the following axes:
ata Structure and Access Patterns
Flash memory holds the data stored in it evenwhen the power is off. So does core memory
,but your gener-
ation will only see that in museums.