Characteristics of a Hierarchical File System – Java I/O: Part II

21.1 Characteristics of a Hierarchical File System

We first look at some characteristics of a hierarchical file system, and introduce the terminology used in this chapter.

Hierarchical File Systems

A file system allows persistent storage and organization of data as a hierarchical (or tree) structure on some external media. A tree structure has a root component (also called root node) at the top, under which other tree nodes represent files and directories. Each directory can have files and nested directories (often called subdirectories). An operative system can have multiple file systems, each of which is identifiable by its root component.

Below is an example of a file system, where the root component is platform dependent. On Unix-based platforms, the root component of the file system is denoted by the slash character (/). The root component for Windows-based platforms is a combination of a volume name (i.e., file system name), a colon (:), and a backslash character (\). For example, C:\ designates the root component of the ubiquitous volume named C on a Windows-based platform.

Click here to view code image

root_component


a
├── b
│   ├── c
│   │   └── d
│   │   │   │
… … … …

When it is not necessary to distinguish between a file and a directory in the file system, we will use the term directory entry to mean both. Each directory entry in a hierarchical file system is uniquely identifiable by a path from the root component to the node representing the directory entry. The path of a directory entry in a file system is specified using the naming conventions of the host system, where name elements that comprise the path are separated by a platform-specific name separator character or delimiter. The name separator character for name elements on Unix-based platforms is the slash character (/), whereas on Windows-based platforms, it is the backslash character (\). For the most part, we will use conventions for Unix-based platforms.

Two examples of paths are given below, where each path has three name elements.

Click here to view code image

/a/b/c           on Unix-based platforms
C:\a\b\c         on Windows-based platforms