CSRU 3595 Operating Systems                                                                             Dept. of Computer & Info Sciences
Fall 2008                                                                                                                   C. Schweikert

Lab Assignment #1 (Chapter 2 - Operating System Structures)
Due: Friday, September 19


2.1 Write a simple C++ program that will copy the contents of one file and write it to another file. Be sure to include necessary error checking, such as checking that the source file exists. Once you have correctly designed and tested the program, run the program using the strace utility that traces system calls.

Hints:

#include<fstream>
using namespace std;

strace ./a.out

2.2 Modify the above program to create your own copy command called mycopy. This program will accept command line arguments for the name of the file to be copied and the name of the destination file.

Hints:

g++ -o mycopy mycopy.cpp

int main(int argc, char* argv[])

./mycopy file1.txt file2.txt

2.3 Create a table to compare features for two of the following operating systems: Windows XP, Windows Vista, Linux, BSD Unix, Mac OS X.