28
2
W H AT I S A F I L E S Y S T E M ?
rest of an operating system can access it is the next most basic operation
needed. Creating files and directories form the backbone of a file system's
functionality. Writing and reading data allows users to store and retrieve
information from permanent storage. The delete and rename operations pro-
vide mechanisms to manage and manipulate files and directories. The read
metadata and write metadata functions allow users to read and modify the
information that the file system maintains about files. Finally, the
opendir
and
readdir
calls allow users to iterate through and enumerate the files in
the directory hierarchy. This basic set of operations provides the minimal
amount of functionality needed in a file system.
2.5
Extended File System Operations
A file system that provided only the most basic features of plain files and
directories would hardly be worth talking about. There are many features
that can enhance the capabilities of a file system. This section discusses
some extensions to a basic file system as well as some of the more advanced
features that modern file systems support.
We will only briefly introduce each of the topics here and defer in-depth
discussion until later chapters.
Symbolic Links
One feature that many file systems implement is symbolic links. A symbolic
link is a way to create a named entity in the file system that simply refers
to another file; that is, a symbolic link is a named entity in a directory, but
instead of the associated i-node referring to a file, the symbolic link contains
the name of another file that should be opened. For example, if a directory
contains a symbolic link named
Feeder
and the symbolic link refers to a file
called
Breeder
, then whenever a program opens
Feeder
, the file system trans-
parently turns that into an open of
Breeder
. Because the connection between
the two files is a simple text string of the file being referred to, the connec-
tion is tenuous. That is, if the file
Breeder
were renamed to
Breeder.old
,
the symbolic link
Feeder
would be left dangling (it still refers to
Breeder
) and
would thus no longer work. Despite this issue, symbolic links are extremely
handy.
Hard Links
Another form of link is known as a hard link. A hard link is also known as an
alias
. A hard link is a much stronger connection to a file. With a hard link, a
named entity in a directory simply contains the i-node number of some other
file instead of its own i-node (in fact, a hard link does not have an i-node at
Practical File System Design:The Be File System
, Dominic Giampaolo
page 28