File Systems and Hierarchical Directory Trees
Imagine walking into a school library with ten thousand textbooks. If all ten thousand books were dumped in a chaotic pile on the floor in the center of the hall, how would you find a specific JSS 2 Civic Education textbook? You would spend three weeks digging through mountains of paper!
To solve this, libraries use bookshelves divided into sections: Sciences, Humanities, Languages, with each shelf clearly labelled by subject and author.
In a computer, a solid-state drive can hold hundreds of thousands of files. To keep your work organized, the Operating System uses a Hierarchical File System shaped like an upside-down tree with roots, branches (folders), and leaves (files). In this lesson, we will master directory structures and file pathnames.
Learning Outcomes
By the end of this lesson, you will be able to:
- Understand the tree hierarchy: Root directory, Parent folders, Subfolders, and Files.
- Read and construct absolute file paths accurately.
- Recognize essential file extensions and their application associations.
- Follow professional file naming conventions (avoiding reserved characters).
Key Vocabulary
| Term | Technical Role |
|---|---|
| Directory (Folder) | A digital container on storage media used to hold and organize files and other subfolders. |
| Root Directory | The highest level of the storage hierarchy (e.g., C:\ on Windows, / on Linux/Mac). |
| Subdirectory | A folder located inside another parent folder. |
| File Path | The complete navigational road map of drive and folder names leading to a specific file. |
| File Extension | A suffix (like .pdf or .docx) that identifies the file type and encoding format. |
Anatomy of a Hierarchical Directory Tree
[ ROOT DIRECTORY: C:\ ]
|
+---> [ Windows ] (Operating System files)
|
+---> [ Program Files ] (Installed software: Word, Chrome)
|
+---> [ Users ]
|
+---> [ Chidi ]
|
+---> [ Documents ]
| |
| +---> [ JSS2_Term1 ]
| |
| +---> Computer_Notes.docx
| +---> Math_Homework.xlsx
|
+---> [ Pictures ]
|
+---> School_Excursion.jpg
Study Notes: Navigating the File System
1. The Directory Hierarchy
- The Root (
C:\): The very top trunk of the tree. Everything on the storage drive lives inside the root. - Parent vs. Child Folders:
- In the diagram above,
Usersis the parent ofChidi. JSS2_Term1is a child (subdirectory) ofDocuments.- Files (Leaves): Individual documents, spreadsheets, songs, or photographs that sit inside folders.
2. Reading an Absolute File Path
A file path is like a complete postal delivery address:
$$\mathbf{C:\backslash Users\backslash Chidi\backslash Documents\backslash JSS2_Term1\backslash Computer_Notes.docx}$$
C:→ The physical storage drive letter (Main SSD/Hard Disk).\→ The path separator symbol (Backslash in Windows; forward slash/in Linux/Mac).Users\Chidi\Documents\JSS2_Term1\→ The exact sequence of nested folders you must open.Computer_Notes→ The specific filename..docx→ The file extension indicating it is a Microsoft Word document.
3. Essential File Extensions Guide
| Extension | File Category | Default Application |
|---|---|---|
.docx |
Formatted Word Document | Microsoft Word / Google Docs |
.xlsx |
Electronic Spreadsheet | Microsoft Excel / Google Sheets |
.pptx |
Slide Show Presentation | Microsoft PowerPoint / Slides |
.pdf |
Portable Document Format (Universal) | Adobe Acrobat / Web Browser |
.jpg / .png |
Compressed Digital Images | Photos App / Paint |
.mp3 |
Compressed Digital Audio | Windows Media Player / Spotify |
.mp4 |
Compressed Digital Video | VLC Player / Media Player |
.py |
Python Programming Source Code | Python IDLE / VS Code |
4. Illegal Characters in Filenames
Operating systems reserve certain symbols for system commands. In Windows, you cannot use the following nine characters in a filename:
$$\backslash \quad / \quad : \quad * \quad ? \quad " \quad < \quad > \quad |$$
If you try to name a file My/Homework:Math?.docx, Windows will reject it because slashes and colons belong to system path navigation!
Worked Example: Organizing a Messy Desktop
Scenario: Boma has thirty files scattered randomly on her computer desktop: 10 math worksheets, 10 science photos, and 10 English essays. She spends five minutes searching for her files every day!
The Professional Solution (Creating a Clean Directory Tree):
1. Boma creates a master folder in Documents called JSS2_Studies.
2. Inside JSS2_Studies, she creates three subfolders:
- 01_Mathematics
- 02_Basic_Science
- 03_English_Language
3. She moves the files into their respective subject subfolders.
4. Now, her file path for math is crystal clear:
C:\Users\Boma\Documents\JSS2_Studies\01_Mathematics\Week3_Fractions.xlsx.
Practical Class Activity: Tracing File Paths
Look at the directory tree diagram in the study notes above and write the complete absolute file path for each of the following two files in your notebook:
- The photograph of the school excursion:
Path:C:\Users\Chidi\Pictures\School_Excursion.jpg - The mathematics homework spreadsheet:
Path:C:\Users\Chidi\Documents\JSS2_Term1\Math_Homework.xlsx
Common Mistakes & Corrections
| Common Mistake | Why It Is Incorrect | Proper Correction |
|---|---|---|
| "Changing a file extension from .docx to .mp3 turns an essay into music." | Renaming the extension only changes the label; it does not convert the underlying binary data format. | Converting file formats requires export or conversion software, not just renaming letters. |
| "Saving every single file on the desktop." | An overcrowded desktop slows down system boot times and makes finding files difficult. | Keep the desktop clean; save files into categorized subject folders inside Documents. |
Notebook Summary
Copy Into Your Computing Notebook
- Operating systems organize storage into a Hierarchical Directory Tree of folders and subfolders.
- The Root Directory (
C:\) is the starting trunk of the drive. - A File Path lists the exact drive and folder sequence leading to a specific file.
- File Extensions (
.docx,.xlsx,.pdf,.py) tell the OS what format the file uses and which app opens it. - Never use reserved characters (
\ / : * ? " < > |) inside filenames.