This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2014:unix:projects:archive_handling [2014/01/18 16:23] – wedge | haas:spring2014:unix:projects:archive_handling [2014/02/04 19:36] (current) – wedge | ||
---|---|---|---|
Line 43: | Line 43: | ||
- | =====Program===== | + | =====Procedure===== |
- | It is your task to write the program that will use the above method to compute the requested one-, two-, or three-digit value against | + | In the UNIX Public Directory you will find a **projects/ |
- | Your program should: | + | There you will find two existing archives: |
- | * obtain its input from the command-line (argument 1, which will be processed against 11) | + | |
- | * if there is no first argument, fall back to asking the user for input | + | |
- | * determine from the input if it is a one-, two-, or three-digit number | + | |
- | * perform the correct algorithm against the input | + | |
- | * propagate any carries | + | |
- | * output the final value | + | |
- | =====Execution===== | + | * archive1.zip |
- | Several operating behaviors are shown, namely, with and without command-line arguments and 1-, 2-, and 3-digit values. | + | * archive2.tar.bz2 |
- | < | + | You'll probably want to make a copy of these to some working directory in your home directory. |
- | lab46: | + | |
- | Enter value: 345 | + | Essentially, |
- | 345 x 11 = 3795 | + | |
- | lab46:~/ | + | |
- | </ | + | |
- | The execution | + | - Figure out the format |
+ | - Extract the contents of the two archives and study them (make sure you keep track of what is in which archive) | ||
+ | - Analyze the archive contents | ||
+ | | ||
+ | * name the files smallest, small, big, biggest, and tack on the appropriate extension | ||
+ | * the smallest file will be whichever file represents the smallest/ | ||
+ | - Create a new archive, called **myarchive.tar** containing only these size-themed files. | ||
+ | * do NOT store any paths in the archive, just put the files at base level | ||
+ | - Compress **myarchive.tar** on second highest (on the best, not fastest end of the spectrum) compression level in gzip to create the appropriately named **myarchive.tar.gz** | ||
+ | * also use the **-n** argument to aid in the verification step below | ||
+ | - Submit **myarchive.tar.gz** using the submit tool. | ||
=====Reflection===== | =====Reflection===== | ||
Be sure to provide any commentary on your opus regarding realizations had and discoveries made during your pursuit of this project. | Be sure to provide any commentary on your opus regarding realizations had and discoveries made during your pursuit of this project. | ||
- | * Does this process work for four digit numbers? | + | * Why do you suppose tar works the way it does? |
- | * How about five digit numbers? | + | * What might be some benefits of separating archival and compression functionality? |
- | * Do you see a pattern for now this trick could be extended? | + | |
=====Submission===== | =====Submission===== | ||
To successfully complete this project, the following criteria must be met: | To successfully complete this project, the following criteria must be met: | ||
- | | + | * Submit a copy of your archive |
- | * Executed program must display a total of 1 or 2 lines (depending on presence of argument) | + | |
- | * Output must be correct, and match the form given in the sample output above. | + | |
- | * Code must be nicely and consistently indented (you may use the **indent** tool) | + | |
- | * Code must be commented | + | |
- | * have a properly filled-out comment banner at the top | + | |
- | * have at least 20% of your program consist of **< | + | |
- | * Output Formatting (including spacing) of program must conform to the provided output (see above). | + | |
- | * Track/ | + | |
- | | + | |
To submit this program to me using the **submit** tool, run the following command at your lab46 prompt: | To submit this program to me using the **submit** tool, run the following command at your lab46 prompt: | ||
Line 90: | Line 81: | ||
<cli> | <cli> | ||
$ submit unix archives myarchive.tar.gz | $ submit unix archives myarchive.tar.gz | ||
- | Submitting | + | Submitting |
- | -> multby11.c(OK) | + | -> myarchive.tar.gz(OK) |
SUCCESSFULLY SUBMITTED | SUCCESSFULLY SUBMITTED | ||
Line 97: | Line 88: | ||
You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches. | You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches. | ||
- | ====Verify submission==== | ||
- | To verify you submitted successfully, | ||
- | |||
- | <cli> | ||
- | lab46:~$ verify cprog multby11 | ||
- | multby11: submitted successfully | ||
- | </ | ||
- | Note if automated assessment is available for the project, you may actually see results in the output as well. |