Hierarchical file system

From HandWiki
Short description: Computer files in nested directories

In computing, "a hierarchical file system is a file system that uses directories to organize files into a tree structure."[1]

In a hierarchical file system, directories contain information about both files and other directories, called subdirectories which, in turn, can point to other subdirectories, and so on.[2] This is organized as a tree structure, or hierarchy, generally portrayed with the root at the top. The root directory is the base of the hierarchy, and is usually stored at some fixed location on disk.

A hierarchical file system contrasts with a flat file system, where information about all files is stored in a single directory, and there are no subdirectories.

Almost all file systems today are hierarchical. What is referred to as a file system is a specific instance of a hierarchical system. For example, NTFS, HPFS, and ext4, all implement a hierarchical system with different features for buffering, file allocation, and file recovery.

Concepts

Path

"A file path describes the location of a file in a web site's folder [directory] structure."[3] That is, it represents the directory nodes visited from the root directory to the file as a list of node names, with the items in the list separated by path separators. The path separator is > on Multics,[4] / on Unix-like systems,[5] and \ on MS-DOS 2.0 and later, Windows, and OS/2 systems.

An absolute path begins at the root directory; that is, begins with a path separator character, which, at the beginning of a path, represents the root directory. A path consisting only of a path separator character refers to the root directory.[6]

Working directory

The working directory of a process is a directory dynamically associated with each process. Files are searched relative to the working directory, rather than from the root directory. At logon, the user's working directory is set to their home directory; it can be set afterwards by using a command.

A relative path represents the directory nodes visited from the working directory to the file, rather than from the root directory to the file. A relative path does not begin with a path separator character.[6]

History

Multics

Multics is the first operating system to provide a hierarchical file system.[7][8]

IBM OS/360

OS/360 has had a hierarchical system since its earliest days.[when?][9]

The system catalog is layered on top of a flat file system, where a disk file's "directory entry" is stored in each volume's Volume Table of Contents (VTOC), and files can be referenced either thru the catalog or by specifying the volume serial number directly. Specifying a dataset name without specifying a serial number in JCL implies a catalog search. The catalog stores only a pointer to the volume.[10]

The OS/360 catalog has a number of differences from other hierarchical file systems. The "root directory", a dataset named SYSCTLG, may contain file pointers or links to subdirectories called CVOLS.[10] The path separator is .. All paths are absolute paths, a leading . is always assumed and cannot be coded. path components (between .) are limited to eight characters. The catalog is not restricted to disk (DASD) files, but can also catalog magnetic tape datasets. Not all volumes indicated in the catalog have to be online, and the system allows disk and tape volumes to be mounted on request following a catalog search.

Unlike most other systems, it is possible to create a file without cataloging it. Cataloging is requested thru JCL or a utility program.

A cataloged dataset name might look like PAYROLL.WEEKLY.HOURS.

IBM virtual storage operating systems replaced SYSCTLG with a VSAM Catalog. Cataloging is mandatory for VSAM datasets, but, as before, non-VSAM datasets may be cataloged or not cataloged. The program "Access Method Services" (IDCAMS) maintains the VSAM Catalog.

Personal computers

The CP/M operating system uses a flat file system, with a directory containing information on a maximum of 64 files—adequate when a floppy disk held only 128 KB. IBM PC DOS and MS-DOS 1.0 inherited the same structure. DOS 2.0, which supported hard disk drives, introduced a hierarchical file system. The hierarchical file system was used instead of simply expanding the flat directory for performance reasons. "A flat DOS file structure with a single directory and 10 times as many files would logically require 10 times as long to search."[2] OS/2 and Windows also support a hierarchical file system, using the same path syntax as DOS.

See also

References

  1. Sharma, Vivek; Varshney, Manish; Sharma, Shantanu (2010). Design and Implementation of Operating System. University Science Press. p. 346. ISBN 9789380386416. https://books.google.com/books?id=3iE3UWrE4L0C&pg=PA346. Retrieved February 22, 2023. 
  2. 2.0 2.1 Stephens, Mark (June 6, 1988). "Netware, LAN Manager Spar in Network Software Contest". InfoWorld 10 (23). https://books.google.com/books?id=-j4EAAAAMBAJ&pg=PA14. Retrieved February 22, 2023. 
  3. "HTML File Paths". https://www.w3schools.com/html/html_filepaths.asp. 
  4. New User's Introduction to Multics - Part I. Honeywell Information Systems. November 1979. p. 6-4. CH24-00. http://www.bitsavers.org/pdf/honeywell/large_systems/multics/CH24-0_multicsIntrPt1_Nov79.pdf. 
  5. Ritchie, Dennis M.; Thompson, Ken (July 1974). "The UNIX Time-Sharing System". Communications of the ACM 17 (7): 365–375. doi:10.1145/361011.361061. 
  6. 6.0 6.1 Rosenthal, Hanaan (2007). AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X (2nd ed.). Apress. p. 703. ISBN 978-1-59059-653-1. https://books.google.com/books?id=Ud9WZg-m87EC&pg=PA703. Retrieved February 23, 2023. 
  7. "Multics Glossary -F-". http://www.multicians.org/mgf.html#filesystem. 
  8. R. C. Daley and P. G. Neumann, "A general-purpose file system for secondary storage", AFIPS '65 (Fall, part I) Proceedings of the November 30 – December 1, 1965
  9. IBM Corporation (1965). IBM Operating System/360 Concepts and facilities. pp. 10–11. http://bitsavers.org/pdf/ibm/360/os/R01-08/C28-6535-0_OS360_Concepts_and_Facilities_1965.pdf. Retrieved February 24, 2020. 
  10. 10.0 10.1 Stephens, David. "The Best Mainframe DASD and Dataset Innovations". Longpela Expertise. http://www.longpelaexpertise.com/ezine/BestDASDInnovations.php.