User Tools

Site Tools


Sidebar

projects

haas:spring2014:unix:projects:archive_handling

This is an old revision of the document!


Corning Community College

CSCS1730 UNIX/Linux Fundamentals

~~TOC~~

Project: ARCHIVE HANDLING

Objective

To begin putting your skills to work accomplishing tasks and solving problems on the system.

Prerequisites

To successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved:

  • ability to read the manual pages and use the information therein
  • ability to copy, move, list, remove, and/or link files
  • ability to navigate around the filesystem

Background

When we talk about archives, there are commonly two separate actions taking place. Sometimes they are intertwined, others they represent discrete steps.

They are:

  • archiving / extracting
  • compression / decompression

Archives are merely a manifestation of a common computing concept: a container.

Containers encapsulate things; in this case- files. And the fact that UNIX tries to make everything a file really enhances the viability of this ability.

Compression, on the other hand, is an action performed on a single file. Utilizing various algorithms, we accomplish a sort of “more in less”… we can take the data present and cram it into a smaller box (file)… where the aim is to take up less storage on the filesystem (also makes copying easier).

There are many compression algorithms in existence. There are commonly two categories of compression algorithm:

  • lossless - no data is lost as a part of the compression process
  • lossy - unnecessary data is discarded as part of the compression process

Wikipedia has categories identifying various algorithms implemented for both lossless and lossy compression algorithms.

Where confusion may set in is when a tool combines the actions of archival AND compression. But if you think about it, even in such cases, we always end up with one file, and that file is compressed (unless we have a concatenation of separately compressed files into a single file.

Archives are useful in that they let us pack items together. If something needs 100 files, making a copy of that, or copying it/install it onto another system would be made more complex if we had to deal with each of those files individually. Archives simplify the problem in that they can provide us all those files, all contained within a single file (lessening opportunities for error). So, archives make our lives easier.

Procedure

It is your task to

Execution

Several operating behaviors are shown, namely, with and without command-line arguments and 1-, 2-, and 3-digit values.

lab46:~/src/cprog/multby11$ ./multby11
Enter value: 345
345 x 11 = 3795
lab46:~/src/cprog/multby11$ 

The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate.

Reflection

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?
  • How about five digit numbers?
  • Do you see a pattern for now this trick could be extended?

Submission

To successfully complete this project, the following criteria must be met:

  • Code must compile cleanly (no warnings or errors)
  • 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 //-style descriptive comments
  • Output Formatting (including spacing) of program must conform to the provided output (see above).
  • Track/version the source code in a repository
  • Submit a copy of your source code to me using the submit tool.

To submit this program to me using the submit tool, run the following command at your lab46 prompt:

$ submit unix archives myarchive.tar.gz 
Submitting unix project "archives":
    -> myarchive.tar.gz(OK)

SUCCESSFULLY SUBMITTED

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.

haas/spring2014/unix/projects/archive_handling.1390250215.txt.gz · Last modified: 2014/01/20 20:36 by wedge