Systems Programming Homework 1
Systems Programming Homework 1
-
All assignments should be completed on wasp.cs.kent.edu or hornet.cs.kent.edu. Your login will be your Flashline login and password.
-
What does the program cp1.c do if you copy a file to itself? Is this what the standard cp program does? If not modify cp1.c to handle the situation in the same way as cp.
In addition, you sometimes want to copy all the files in a directory into another directory, for example
to make a backup.
Modify the cp1.c program so that if given two directory names
as arguments, it copies all the files in the first directory into the second directory,
giving each copy the same name as the original.
If the second argument exists but is not a directory, it should exit with an error message.
If the second argument does not exist, it should create a directory with that name,
and copy all the files in the first directory into it giving each copy the same name as the original.
-
The utmplib.c returns all utmp records.
Modify it instead to return only the records that represent active sessions, similar to who3.c. Modify who3.c to use this modified utmplib.c and call it who4.c.
Also modify this program to allow the user to specify an optional filename, which will be examined instead of utmp. To test it use it to examine the /var/log/wtmp file.
- Place both programs and a Makefile and any other information on running them in a directory hw1 for which the permissions only permit the user (you) to access it.
This assignment is an individual assignment, to be done on your own without help from other students in the class.
Instructions for submitting the homework using svn are contained in
this file.
Due: Tuesday February 9, 2016.
Paul A. Farrell