CrashCourse · @crashcourse
Files & File Systems: Crash Course Computer Science #20
Uploaded June 8, 2018 · Length 12:03
Summary
This video explains how computer files work, including file formats like TXT, WAV, and BMP, and how file systems organize them using directory files and blocks.
- computer files explained
- file formats
- file systems
- directory files
- metadata
- data storage
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:03
Hi, I'm Carrie Anne, and welcome to Crash Course Computer Science!
- 0:05
Last episode we talked about data storage, how technologies like magnetic tape and hard
- 0:10
disks can store millions, billions and trillions of bits of data, for long durations, even
- 0:13
without power.
- 0:14
Which is perfect for recording “big blobs” of related data, what are more commonly called
- 0:18
computer files.
- 0:19
You’ve no doubt encountered many types, like text files, music files, photos and videos.
- 0:24
Today, we’re going to talk about how files work, and how computers keep them all organized
- 0:28
with File Systems.
- 0:29
INTRO
- 0:38
It’s perfectly legal for a file to contain arbitrary, unformatted data, but it’s most
- 0:43
useful and practical if the data inside the file is organized somehow.
- 0:47
This is called a file format.
- 0:48
You can invent your own, and programmers do that from time to time, but it’s usually
- 0:52
best and easiest to use an existing standard, like JPEG and MP3.
- 0:56
Let’s look at some simple file formats.
- 0:58
The most straightforward are T-X-T files, which contain, surprise, text.
- 1:04
Like all computer files, this is just a huge list of numbers, stored as binary.
- 1:08
If we look at the raw values of a T-X-T file in storage, it would look something like this:
- 1:13
We can view this as decimal numbers instead of binary, but that still doesn’t help us
- 1:16
read the text.
- 1:17
The key to interpreting this data is knowing that T-X-T files use ASCII, a character encoding
- 1:22
standard we discussed way back in Episode 4.
- 1:24
So, in ASCII, our first value, 72, maps to the capital letter H. And in this way, we
- 1:29
decode the whole file.
- 1:31
Let’s look at a more complicated example: a WAVE File – also called a WAV – which
- 1:35
stores audio.
- 1:36
Before we can correctly read the data, we need to know some information, like the bit
- 1:40
rate and whether it’s a single track or stereo.
- 1:42
Data, about data, is called meta data.
- 1:45
This metadata is stored at the front of the file, ahead of any actual data, in what’s
- 1:49
known as a Header.
- 1:50
Here’s what the first 44 bytes of a WAV file looks like.
- 1:53
Some parts are always the same, like where it spells out W-A-V-E.
- 1:58
Other parts contain numbers that change depending on the data contained within.


