TAR Filesystem

Updated: May 06, 2022

The .tar file resource manager is similar to the previous chapter's RAM-disk filesystem manager, and they share quite a bit of code. However, it illustrates a different way of managing files — as a virtual filesystem map of a physical file.

This resource manager lets you cd into a .tar (or, through the magic of the zlib compression library, into a .tar.gz) file, and perform ls, cp, and other commands, as if you had gone through the trouble of (optionally uncompressing and) unpacking the .tar file into a temporary directory. (That's a small lie; a directory entry can't be both a file and a directory at the same time, so you can't cd into the .tar file, but the resource manager creates a .tar.dir file that you can cd into.)

In the Filesystems appendix, I present background information about filesystem implementation within the resource manager framework. You might want to refer to that before, during, or after you read this chapter.

I assume that you've read the RAM-disk Filesystem chapter, because anything that's common between these two resource managers isn't repeated here.