Tar files are files which contain a collection of other files, similar in idea to .zip files. Since the submission system used by the undergrad only allows one file to be submitted per student, the usual way to submit many files is to put them into a single tar file and then submit the tar file. This page describes how to manipulate tar files and submit them to the assignment submission system.
tar -cvf tarfile.tar file1 file2 file3 ...
where tarfile.tar is the name of the tar file to create, and file1 file2 file3 ... is a space-separated list of files and/or directories to put into tarfile.tar. The tar program will print a list of all the files which have been put into the newly created tar file.
tar -cvf ppass1.tar String.h String.cc
creates a tar file called ppass1.tar which contains the two files String.h and String.cc.
bash$ ls String.*
String.h String.cc
bash$ tar -cvf ppass1.tar String.*
String.h
String.cc
tar -cvf String.h String.cc
The user has forgotten to specify the name of the tar file as ppass1.tar, but the tar program doesn't know that. Instead, it creates a tar file named String.h (deleting whatever is inside the String.h file) which contains only the String.cc file. Needless to say, this is very bad if you didn't want to destroy your original String.h file.
tar -tvvf tarfile.tar
where tarfile.tar is the name of the tar file to list.
bash$ tar -tvvf ppass1.tar -rw-r--r-- kev/bstaff 2378 Dec 22 22:40 2001 String.cc -rw-r--r-- kev/bstaff 194 Dec 22 22:40 2001 String.h
tar -xvf tarfile.tar
where tarfile.tar is the name of the tar file to extract. The files will be extracted into the current directory.
bash$ ls ppass1.tar bash$ tar -tvvf ppass1.tar -rw-r--r-- kev/bstaff 2378 Dec 22 22:40 2001 String.cc -rw-r--r-- kev/bstaff 194 Dec 22 22:40 2001 String.h bash$ tar -xvf ppass1.tar String.cc String.h bash$ ls String.cc String.h ppass1.tar
givelist
bash$ givelist Name Sufx Category Until Cse Description comp2004s.a0 .tar ontime Wed Jan 9 17:00 Adder comp2004s.a1 .tar ontime Mon Jan 14 17:00 Roman Numeral Converter
givelist assignment
where assignment is the name of the assignment. You can list assignments which aren't active (ie. which don't show up in a normal givelist command).
bash$ givelist comp2004s.a2 Name: comp2004s.a2 File suffix: .tar Description: Calendar System Start date for assignment: Tue Jan 15 00:00. Due dates and their categories are: ontime Fri Jan 25 17:00 late Fri Jan 25 17:05
submit file assignment
where file is the name of the file to submit, and assignment is the name of the assignment to submit to.
submit ppass1.tar comp2004s.a1
givepeek assignment > file
where assignment is the name of the assignment to retreive, and file is the filename into which a copy of your submission should be placed. If it already exists it will be deleted.
givepeek comp2004s.a1 > ppass1-submitted.tar
mkdir ppass1-submission
cd ppass1-submission
givepeek comp2004s.a1 > ppass1.tar
tar -xvf ppass1.tar
and you will now have a directory called ppass1-submission which contains your submitted tar file in ppass1.tar and all of the files inside that tar file. You could now test the compilation by running g++ -Wall -g -c String.cc or make or whatever command is appropriate.