Answer of exercise 3

If the option -a is supplied, we need to do

openfile output_name [O_WRONLY; O_CREAT; O_APPEND] 0o666

instead of

openfile output_name [O_WRONLY; O_CREAT; O_TRUNC] 0o666

Parsing the new option from the command line is left to the reader.

* * *