Compare the different directory structures (single-level, two-level, tree, acyclic-graph).
Last updated
Directory structures organize how file names map to files; they evolved from flat listings to hierarchical trees and shared graphs to solve naming collisions, isolation, and sharing.
Single-level directory:
One directory for all files on the system.
Simple, but every file name must be globally unique and it doesn't scale for multiple users.
Two-level directory:
A separate directory per user under a master file directory.
Solves name collisions between users, but no sub-grouping and sharing is awkward.
Tree-structured directory:
Arbitrary nesting of directories; each file has one unique absolute path.
Supports absolute and relative paths and a current working directory; the standard model.
Limitation: strictly one parent, so true sharing needs duplication.
Acyclic-graph directory:
Allows shared subdirectories/files via links (e.g. hard links), so one file has multiple paths.
Must avoid cycles and handle deletion carefully: use reference counts so a file is freed only when the last link is removed (dangling-pointer problem with symbolic links).
- https://www.geeksforgeeks.org/operating-systems/structures-of-directory-in-operating-system/
- https://www.binaryvisual.com/operating-systems/directory-structure
- https://www.tutorialspoint.com/operating_system/structures_of_directory_in_operating_system.htm
- https://www.codechef.com/learn/course/operating-system/FILEBASIC/problems/OOPSPROB269
- https://www.youtube.com/watch?v=eK_mEHG20PA
- https://mushfequr1984.medium.com/file-system-in-operating-system-a-brief-overview-3260a85454e4
- https://medium.com/@parul947a/file-management-in-os-2bf0acf469f5
- https://askfilo.com/user-question-answers-smart-solutions/describe-different-directory-structures-in-operating-systems-3335353033313535