CS 211 Lab 1

Fall 2012

Due: Tuesday 9/4/2012 at 11:59pm

A simple copy command

For this lab, you are to write a simple version of the Linux/Unix copy command: cp.

This is to be written in the C programming languange.

The command is to take two command line arguments:

  1. the original filename
  2. the destination filename
The program should first verify that there are two command line arguments. These arguments are to be used as names for file input/output.

The program is to open the first command line argument for reading and the second command line argument for writing. Then it should read the contents of the first file until it reaches the end of the file and place those contents into the second file.

Both files need to be closed before the program terminates.

Program Submission

Your are to submit the program for this lab via the Assignments Page in Blackboard.

To help the TA, name your file with your net-id and the assignment name, like:

  • ptroy1Lab1.c

Submit this file via the Assignment Link for Lab 1 in Blackboard.

  1. In the CS 211 Web Pages in Blackboard, go to the Assignments Page
  2. Click on the link "Lab 1". This will open a web page with the title: "Upload Assignment: Lab 1"
  3. Scroll down and click on the button "Browse for Local File"
  4. Select the file that you created that contains hte program. Then click OK
  5. Click the submit button on the "Upload Assignment: Lab 1" page.
  6. You should see the Submission History page that shows what you submitted. Verify you actually submitted the correct information.

Code Developed during Lab

-- Main.troy - 2012-08-29
Topic attachments
I Attachment Action Size Date Who Comment
C source code filec fcopy.c manage 0.8 K 2012-08-29 - 17:58 UnknownUser  
Topic revision: r3 - 2012-08-31 - 13:23:36 - Main.troy
 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF