Unix Systems Programming: Lab 3 - stat, file I/O, libraries & make



Due:           Monday, February 4 @ 5:00 pm

Purpose and Rationale

The purpose of this lab is to allow students to become comfortable with Unix file I/O operations, make and makefiles, and building libraries.

Resources

FAQ (submission instructions and other useful stuff)

If you are not in our course email list, please subscribe to the cspp51081 email list here:
        http://mailman.cs.uchicago.edu/mailman/listinfo/cspp51081

Lecture 3 is the primary source for this lab.

All work should be done on a machine in the department's Linux cluster. You can refer to ssh for more information on how to log into a remote machine.

Marks Distribution

Exercise 1 5 points
Exercise 2 5 points
Exercise 3 6 points
TOTAL 16 points

LAB 3

Deliverables

Carefully follow the steps below.

    1. Please create subdirectories ex1, ex2, and ex3, and place each exercise's materials in its respective directory as described below:

      • Directory ex1 will include at least three files.
        • Source code files: You may organize your files anyway you like.
        • Makefile: it must build your executable named mystat when we type make on the command line.
        • README : This file must include the correct command line syntax (including the available option in you do the bonus), a brief explanation of your command (including the extra functionality if you do the bonus) and the transcript of one example of your command in the default mode (if you are doing the bonus option, submit a second example showing your option at work.)

      • Directory ex2 will include at least three files.
        • Source code files: You may organize your files anyway you like.
        • Makefile: it must build your executable name filecopy when we type make on the command line.
        • README : This file must include the correct command line syntax of filecopy and a brief explanation of what it does. There is no need to send a transcript of it in action.

      • Directory ex3 will include eight files.
        • Source code files : main.c, hello.c, bye.c, here.c, mylib.h
        • Two Make files, which will build an executable called : main
             Makefile1 : for building static library
             Makefile2 : for building shared library
        • README : it will contain two lines, the exact command line argument to build an executable called main
             make -f Makefile1 target
             make -f Makefile2 target
    2. When you are finished with your directory you will create a compressed archive file using tar (this utility stores your directory as a single file, then compresses its size.)
             tar -czvf   username.lab3.tgz   username.lab3

    3. You will email your file to our grader as an attachment. She will send an acknowledgement that your assignment has been received.

  1. Maria Power