Exercise
Explore practical programming exercises focused on UNIX file system APIs. Learn to implement commands for listing files, obtaining file stats, efficiently reading file ends, and recursively searching directories. Gain hands-on experience with system calls like stat(), opendir(), readdir(), and lseek() to deepen understanding of persistent storage management.
We'll cover the following...
In this exercise, we’ll just familiarize ourselves with how the APIs described in the chapter work. To do so, you’ll just write a few different programs, mostly based on various UNIX utilities.
Feel free to discuss your solutions on this exercise’s Discuss forum thread.
Questions
-
Stat: Write your own version of the command line program
stat, which simply calls thestat()system call on a given file or directory. Print out file size, number of blocks allocated, ...