0% found this document useful (0 votes)
20 views7 pages

Understanding Hierarchical Filesystems

week 2 lecture notes

Uploaded by

kierstimiller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views7 pages

Understanding Hierarchical Filesystems

week 2 lecture notes

Uploaded by

kierstimiller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

OPS102: OPERATING SYSTEMS FOR PROGRAMMERS

MODULE 3

FILESYSTEMS
HIERARCHICAL FILESYSTEMS
 Most modern computers are equipped with one or more random-access storage devices -
- either a mechanical hard disk drive (HDD), or a fully electronic solid state disk (SSD).
Both of these provide a numbered set of blocks or sectors, each of which stores a set
amount of data (typically 512 or 1024 bytes).
 In order to conveniently use this storage, it is arranged into files, which are named
collections of bytes of arbitrary length. The organization of blocks/sectors into files is
handled by a filesystem, which is a scheme for structuring data, along with the
corresponding software to implement this scheme. Most filesystems track certain
metadata about a file in addition to the file name (or "filename"), such as the date/time of
creation, the date/time of last modification, the owner or original creator of the file, and
the permissions applicable to the file (for example, who is permitted to read and to
change the file contents).
 A hierarchical filesystem introduces the concept of directories, which are special files
which hold zero or more other files. The files in a directory may themselves be directories,
enabling files to be nested into an arbitrary hierarchy. The master directory is called
the root directory.
 When graphical user interfaces were developed, the metaphor of a traditional paper-
based office was introduced, and directories were called folders in this metaphor (a folder
in a traditional office is a piece of card stock folded in half to group together related
papers). Therefore, the terms directory and folder are synonyms.
FILENAMES
 The rules for valid filenames vary with the filesystem, but generally, filenames may
include letters, numbers, dashes, underscores, and periods. Other punctuation marks
may be acceptable in some filesystems but not in others, and are therefore best avoided,
especially if files may be transferred between different types of filesystems or between
computers.
 Spaces may be included in filenames but may require quoting if accessed from the
command-line, so that the shell does not interpret the filename as two or more separate
filenames. For example, the filename "red leaf" may be interpreted as two separate
filenames if written without quoting:
 $ls red leaf
 When quotes are added, the ambiguity is removed, and the shell will correctly interpret
the filename as a single name:
 $ls “red leaf”
 For this reason, it is good practice to avoid using spaces in filenames (underscores are a
good alternative).
EXTENSIONS
 Many operating systems (e.g. Windows) use an extension at the end of a filename to
denote the type of data stored in the file. These extensions are delimited by a period
followed by one or more characters. For example, in the filename:
 Ops102_project.pdf
 The extension is "pdf", denoting a file in Portable Document Format.
 It is unusual to use multiple extensions on a Windows system, but not uncommon on a
Linux (or other Unix-like) system.
 For example, on a Linux system, the filename
 Backup.tar.gz
 Has two extensions, “tar” indicating an archive created with the tar command, and “gz”
indicating the file was compressed with the gzip command.
CASE SENSITIVITY

 Some filesystems are case-sensitive whereas UPP and lowercase are considered
unique.
 For example, the following refer to three different files (Linux and Unix):
 MILK.PDF
 Milk.pdf
 milk.pdf
 Most Windows filesystems are NOT case sensitive. Consequently, the above filenames
would refer to the same file.
CURRENT (WORKING) DIRECTORY

 Most operating systems have the concept of a "current directory" or "working directory",
which allows a directory to be temporarily designated as the current working location. The
working directory may be changed at any time.
ABSOLUTE PATHNAME
 An absolute pathname starts with a slash (on Unix-based operating systems, such as
Linux), or a backslash (on Windows), indicating the root directory. It contains the names
of all of the directories from the root directory to the specified file, separated by
slash/backslash characters.
 For example, on a Linux system, the pathname:
 /home/john/ops102/presentation.pdf
 indicates that the file presentation.pdf can be found by starting at the root directory, then
traversing to a directory named "home" containing the directory “john" containing the
directory "ops102" containing the file ("presentation.pdf").
 Similarly, the Windows pathname:
 \Users\john\ops102\presentation.pdf
 indicates that the file presentation.pdf can be found by starting at the root directory, then
traversing to a directory named "Users" containin the directory “john" containing the
directory "ops102" containing the file ("presentation.pdf").
 Absolute pathnames can be readily identified by the fact that they start with the
slash/backslash character. They are often the longest form of the pathname, but they are
unambiguous.

You might also like