Directories
Directories provide a way to organize files in a hierarchical structure.
A directory contains a list of entries that reference other files or directories. Each entry maps a name to an inode number.
For example, a directory could contain:
- Entry for fileA -> inode 21
- Entry for fileB -> inode 33
- Entry for subdirX -> inode 57
This creates a tree of directories and files:
- Directories contain references to files/other directories
- These child directories can contain more files/dirs
- Allows building a folder hierarchy
So directories have a specific internal structure:
- List of entries mapping names -> inodes
- Each entry points to a file or subdirectory
- Allows nested folder structure
Like files, directories are also identified by an inode number within the file system.