01Why do we need folders?
If every photo, document, program, and song on a computer were piled in one place, finding anything would be difficult.
That is why operating systems use folders to help us organize things. In more formal computer terminology, a folder is often called a directory.
Everything piled together
Photos, homework, programs, and music are mixed up
Sorted into groups
Files are much easier to find
02What is a folder inside the system?
We often imagine a folder as a “box” with many files inside.
That is an intuitive analogy, but it is not quite how the underlying system works. From the file system’s point of view, a directory is more like a “table matching names to objects”: it records which names are in the directory and which files or subdirectories those names refer to.
The folder we see
Looks like an openable box
03Why do folders look like a tree?
Folders can contain other folders. Nesting them creates a tree structure.
You can think of the top as the “root,” with branches splitting below it. This organization is often called a directory tree.
04How does a computer find a file precisely?
Knowing only a file name is not enough. If a computer has many files called notes.txt, the system also needs to know which directory contains each one.
The sequence of folders you pass through from a starting point to reach a file is called a path.
C:\Users\Student\Documents\notes.txt/home/student/Documents/notes.txtA complete route written from the system’s root is an absolute path. A route written from the “current directory” is a relative path.
05Why can different folders contain files with the same name?
Because the system identifies a file by its full path, not just its final file name.
/School/notes.txt/Travel/notes.txtBoth files are called notes.txt, but they are in different directories, so their paths differ and the system can tell them apart.
06What happens when you move a file?
From a user’s point of view, “moving a file” means dragging it from one folder to another. What happens underneath depends on the situation.
Move within one file system
Often only the directory relationships and path information need to change
Move between storage devices
Usually the data must be copied first, then the original file is deleted
That is why moving a very large file can sometimes be quick and sometimes take a while.
07How large is a folder itself?
When the system says “this folder is 2 GB,” it usually means the combined size of the contents of all files and subfolders inside it.
Directory data structures also use a small amount of file-system space, but the “folder size” we usually see focuses on the total size of its contents.
What have you learned?
- The formal term for a folder is usually directory; it mainly organizes files and other directories.
- “A folder is like a box” is a useful beginner analogy, but underneath it is closer to a directory structure that records relationships between names and file objects.
- Directories can be nested, forming a tree structure.
- A path describes a route from a starting point to a file or directory. Paths can be absolute or relative.
- Different directories can contain files with the same name because their full paths differ.
- Moving a file within one file system often only changes directory records; moving between devices usually copies the data.
- Folders use a little file-system space, but the displayed folder size usually totals the contents inside.
- The real value of folders is not “holding stuff,” but creating a clear, searchable hierarchy for many files.
Next question: When you delete a file, does it really disappear from the hard drive immediately? Next: Where Does a File Go After You Delete It?