Introduction
Announcements

Schedule
Labs
Assignments
TA office hours

Tests, exam

Topic videos
Some course notes
Extra problems
Lecture recordings

Discussion board

Grades so far

Assignment three questions and answers

Here are some questions and answers about assignment three, and other notes. Suggestions for additions to this list are welcome (e.g. via e-mail).

Click on the highlighted text to expand an item. [EXPAND ALL]


The general notes at the beginning of the assignment two Q&A page also apply to assignment three, |+|
Q: When I compile my program I get the following warning message: |+|
Remember that you only submit the .c files. |+|
Q: Do we have to check for errors from fork(), wait(), etc? |+|
Q: What's the best way to write "true" and "false" as constants in C? |+|
Don't use casts (except for NULL in execl()). |+|
Q: Various segfault problems ("Segmentation exception"). |+|
Q: How do we compile testscandir.c together with myscandir.c? |+|
Q: Do we really need to copy myscandir.h? Can't we tell gcc where to find it? |+|
Q: Since there's no "filter" argument to myscandir(), does this mean it also stores "." and ".." in the array? |+|
myscandir.c does not include a main(); |+|
Library routines such as myscandir() don't call perror() upon error. |+|
Don't call memcpy or bcopy in myscandir(). |+|
Q: How do we know how many struct-dirent items to malloc in myscandir before we read the directory? |+|
Q: May I modify the supplied myscandir.h to declare helper functions? |+|
Q: Does "tree" take a '−v' option? Is this required? |+|
Q: Is there a distinction between a key's having a value which is the empty string, and a key not existing at all? |+|
More notes about tree.c: |+|
Q: How do I use read()? |+|
A common problem when programming with pipes is |+|
Q: Why does benode() return int when its value isn't used in the sample main()? |+|