creating a zipfile - pisanorg/w GitHub Wiki

Generic Instructions for Creating zip File

For the assignments you have to create a zip file in a specific format with the right files in the right directories in it. The example below assumes you are submitting ass1.zip with poly.h and poly.cpp in it.

Let's look at several ways to create a ass1.zip with poly.h and poly.cpp in it. When we unzip this file, it should create a directory called ass1 and should place both the files in it. Using unzip -l ass1.zip under unix should display something like:

> unzip -l ass1.zip 
Archive:  ass1.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       16  12-14-2017 23:39   ass1/poly.h
       18  12-14-2017 23:39   ass1/poly.cpp
---------                     -------
       34                     2 files

Method 1: Using Google Drive

This method does not require any specific software.

  1. Create a directory named ass1 on Google Drive https://drive.google.com/
  2. Put poly.h and poly.cpp into ass1
  3. Right-click on ass1 and choose Download
  4. The file downloaded will have a name like ass1-20171215T074742Z-001.zip. Rename the file as ass1.zip
  5. Check that when you unzip ass1.zip it creates a directory ass1 with the correct files in it.

Method 2: Using linux machines

This will also work for Macs since you can execute unix commands in Terminal

  1. Create a directory ass1 on the linux machines uw1-320-lab.uwb.edu
  2. Put poly.h and poly.cpp into ass1
  3. In the parent directory of ass1 execute the below commands
> ls -al ass1
total 16
drwxr-xr-x  4 yusuf  staff  136 Dec 14 23:54 .
drwxr-xr-x  3 yusuf  staff  102 Dec 14 23:54 ..
-rw-r--r--  1 yusuf  staff   18 Dec 14 23:54 poly.cpp
-rw-r--r--  1 yusuf  staff   16 Dec 14 23:54 poly.h
> zip -r ass1.zip ass1
  adding: ass1/ (stored 0%)
  adding: ass1/poly.cpp (stored 0%)
  adding: ass1/poly.h (stored 0%)
> ls -al ass1.zip
-rw-r--r--  1 yusuf  staff  498 Dec 14 23:54 ass1.zip
> unzip -l ass1.zip
Archive:  ass1.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  12-14-2017 23:54   ass1/
       18  12-14-2017 23:54   ass1/poly.cpp
       16  12-14-2017 23:54   ass1/poly.h
---------                     -------
       34                     3 files

Method 3: Using Windows

  1. Create a directory ass1
  2. Put poly.h and poly.cpp into ass1
  3. Right-click an ass1, choose 7-Zip and then choose Add to ass1.zip

To confirm that the zip file is properly created

  1. Remove the folder ass1
  2. Right-click on ass1.zip, choose Extract all to recreate the folder ass1

When working with zip files, make sure you always use Extract all. If you double-click a zip file, Windows will let you examine the files inside it. You may even be able to open some of the files inside the zip file, but a lot of programs won't work properly.

Method 4: Using Mac

  1. Create a directory ass1
  2. Put poly.h and poly.cpp into ass1
  3. Right-click an ass1, choose Compress "ass1"

To confirm that the zip file is properly created

  1. Remove the folder ass1
  2. Double-click on ass1.zip, you should see the folder ass1

Make sure you follow the assignment instructions for creating a zip file. Only include the files requested in the zip file. Never include executables.