Imperatives are simply statements in programs that affect the “state” of our computer. While we’ve used these inside of our programs to affect the value of variables, mutate properties of objects, and even print outputs to the Interactions window, so far our changes have been limited to DrRacket itself. What if instead, we used this idea of imperative changes to affect the computer itself by modifying files and folders on our machines?

Computers refer to every folder (directory) and file on your computer via a pathname. These pathnames represent “how to get from the root of the file system to the file/folder you want.

They also represent “paths” along a tree that represents our file system. A tree you say!?!? We know how to deal with those! So let’s try out some tree recursion but with file systems!

Then in the Tutorial this week we’ll use additional functions to write some cool stuff that actually modifies our computers!


Today's Resources

1. Exercise Files

Download Exercise Files

2. Slides

3. Pre-Recorded Lecture Video(s), Mini-Quizzes, and Live Recordings

Available Videos
Link Title Type Duration
Video 0 Intro to Files and Folders pre-recorded 9:00
Video 1 Traversing the File System

(MQ - No Longer Available)

video_quiz 7:58