CrashCourse · @crashcourse

Files & File Systems: Crash Course Computer Science #20

Uploaded June 8, 2018 · Length 12:03

Files & File Systems: Crash Course Computer Science #20

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.

  1. 0:03

    Hi, I'm Carrie Anne, and welcome to Crash Course Computer Science!

  2. 0:05

    Last episode we talked about data storage, how technologies like magnetic tape and hard

  3. 0:10

    disks can store millions, billions and trillions of bits of data, for long durations, even

  4. 0:13

    without power.

  5. 0:14

    Which is perfect for recording “big blobs” of related data, what are more commonly called

  6. 0:18

    computer files.

  7. 0:19

    You’ve no doubt encountered many types, like text files, music files, photos and videos.

  8. 0:24

    Today, we’re going to talk about how files work, and how computers keep them all organized

  9. 0:28

    with File Systems.

  10. 0:29

    INTRO

  11. 0:38

    It’s perfectly legal for a file to contain arbitrary, unformatted data, but it’s most

  12. 0:43

    useful and practical if the data inside the file is organized somehow.

  13. 0:47

    This is called a file format.

  14. 0:48

    You can invent your own, and programmers do that from time to time, but it’s usually

  15. 0:52

    best and easiest to use an existing standard, like JPEG and MP3.

  16. 0:56

    Let’s look at some simple file formats.

  17. 0:58

    The most straightforward are T-X-T files, which contain, surprise, text.

  18. 1:04

    Like all computer files, this is just a huge list of numbers, stored as binary.

  19. 1:08

    If we look at the raw values of a T-X-T file in storage, it would look something like this:

  20. 1:13

    We can view this as decimal numbers instead of binary, but that still doesn’t help us

  21. 1:16

    read the text.

  22. 1:17

    The key to interpreting this data is knowing that T-X-T files use ASCII, a character encoding

  23. 1:22

    standard we discussed way back in Episode 4.

  24. 1:24

    So, in ASCII, our first value, 72, maps to the capital letter H. And in this way, we

  25. 1:29

    decode the whole file.

  26. 1:31

    Let’s look at a more complicated example: a WAVE File – also called a WAV – which

  27. 1:35

    stores audio.

  28. 1:36

    Before we can correctly read the data, we need to know some information, like the bit

  29. 1:40

    rate and whether it’s a single track or stereo.

  30. 1:42

    Data, about data, is called meta data.

  31. 1:45

    This metadata is stored at the front of the file, ahead of any actual data, in what’s

  32. 1:49

    known as a Header.

  33. 1:50

    Here’s what the first 44 bytes of a WAV file looks like.

  34. 1:53

    Some parts are always the same, like where it spells out W-A-V-E.

  35. 1:58

    Other parts contain numbers that change depending on the data contained within.