The File System

A file system is the way your computer stores and organizes its files. Your hard drive, external hard drive, and USB drive are all part of your file system. When you create a file, your file system allocates space on the hard drive for that file and then creates a pointer from the filename to the allocated space (see Figure 3.1). Based on the file type, the file system tries to guess how much space will be needed for that file. If the file’s data outgrows the space originally allocated, the file system allocates more space. When a file is deleted, the file system does not remove the data; it simply removes the pointer and deallocates the file’s space on the hard drive, freeing it up for other files to use (see Figure 3.2). This ...

Get Learning to Program now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.