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.
- Create a directory named
ass1on Google Drive https://drive.google.com/ - Put
poly.handpoly.cppintoass1 - Right-click on
ass1and choose Download - The file downloaded will have a name like
ass1-20171215T074742Z-001.zip. Rename the file asass1.zip - Check that when you unzip
ass1.zipit creates a directoryass1with the correct files in it.
Method 2: Using linux machines
This will also work for Macs since you can execute unix commands in Terminal
- Create a directory
ass1on the linux machinesuw1-320-lab.uwb.edu - Put
poly.handpoly.cppintoass1 - In the parent directory of
ass1execute 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
- Create a directory
ass1 - Put
poly.handpoly.cppintoass1 - Right-click an
ass1, choose7-Zipand then chooseAdd to ass1.zip
To confirm that the zip file is properly created
- Remove the folder
ass1 - Right-click on
ass1.zip, chooseExtract allto recreate the folderass1
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
- Create a directory
ass1 - Put
poly.handpoly.cppintoass1 - Right-click an
ass1, chooseCompress "ass1"
To confirm that the zip file is properly created
- Remove the folder
ass1 - Double-click on
ass1.zip, you should see the folderass1
Make sure you follow the assignment instructions for creating a zip file. Only include the files requested in the zip file. Never include executables.