Jump to content

Hierarchical file system

From Wikipedia, the free encyclopedia
(Redirected from File tree)
Example of a directory structure in a hierarchical file system

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

[edit]

Path

[edit]

A file path is a string of characters that contains the location of a file in a computer's file structure.[3][4] 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,[5] / on Unix-like systems,[6] 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.[7]

Working directory

[edit]

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.[8]

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.[7]

History

[edit]

Multics

[edit]

Multics is the first operating system to provide a hierarchical file system.[9][10] File names can be any length or format, multiple names for a particular file or directory, and symbolic connections between the directories (symlinks) are one of the many other features Multics introduced with its hierarchical file system.[11]

IBM OS/360

[edit]

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

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.[13]

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.[13] 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

[edit]

DOS and Windows

[edit]

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.

Classic Mac OS

[edit]

All versions of Classic Mac OS before System 2.1 used a flat file system, the Macintosh File System, which maintained all the files in a single list, however Finder provided the illusion of folders with records maintained in the Desktop file.[14] From System 2.1 onwards, the Macintosh File System was superseded by the Hierarchical File System which allowed for multiple layers of folders and files.[15]

See also

[edit]

References

[edit]
  1. ^ Sharma, Vivek; Varshney, Manish; Sharma, Shantanu (2010). Design and Implementation of Operating System. University Science Press. p. 346. ISBN 9789380386416. Retrieved February 22, 2023.
  2. ^ a b Stephens, Mark (June 6, 1988). "Netware, LAN Manager Spar in Network Software Contest". InfoWorld. Vol. 10, no. 23. Retrieved February 22, 2023.
  3. ^ "HTML File Paths". W3Schools. Retrieved February 22, 2023.
  4. ^ "General | File Paths". Codecademy. Retrieved 2024-03-20.
  5. ^ New User's Introduction to Multics - Part I (PDF). Honeywell Information Systems. November 1979. p. 6-4. CH24-00.
  6. ^ 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.
  7. ^ a b 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. Retrieved February 23, 2023.
  8. ^ "What is a Current Directory?". www.computerhope.com. Retrieved 2024-03-20.
  9. ^ "Multics Glossary -F-". www.multicians.org. Retrieved April 11, 2018.
  10. ^ 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
  11. ^ "What is MULTICS?". GeeksforGeeks. 2024-01-01. Retrieved 2024-03-20.
  12. ^ IBM Corporation (1965). IBM Operating System/360 Concepts and facilities (PDF). pp. 10–11. Retrieved February 24, 2020.
  13. ^ a b Stephens, David. "The Best Mainframe DASD and Dataset Innovations". Longpela Mainframe Quarterly. Longpela Expertise. Retrieved February 24, 2023.
  14. ^ Cow, Dog (2018-08-05). "All About MFS: The Macintosh File System". Mac GUI. Archived from the original on 2023-07-17. Retrieved 2024-08-27.{{cite web}}: CS1 maint: unfit URL (link)
  15. ^ Cow, Dog (2017-11-08). "HFS Origins: The Turbo File System". Mac GUI. Archived from the original on 2023-07-17. Retrieved 2024-08-27.{{cite web}}: CS1 maint: unfit URL (link)