Clarifications of exercise

Directory entries: you are required to use the first and second files to work on. Note that these files are the 3rd and 4rth directory entries, respectively. That is because "." and ".." are the first 2 directory entries.

Useful information for exercise

Getting directory information

You can use the documentation on the "getdents" system call. However, some of the documentation is a bit confusing, and there are several versions depending on the system version, so below is some clarification of the confusing part. You still need to refer to the docs.

The arguments to the system call are:

Returned value is how many bytes of information were transfered - less or equal to the 3rd argument. It will be less if the total directory information is less than the buffer size.

The data transfered to the buffer is a "list" (i.e. a sequence of bytes containing one structure followed by the next, etc.) of directory entry structures, where each structure is as follows: