Struggling with Zip

Helpful tips and guides, also new users can ask for help here.
Post Reply
User avatar
Sebright
ROM Dongle
Posts: 12
Joined: Fri Feb 07, 2025 9:55 am

Struggling with Zip

Post by Sebright »

Hi,

My aim is to get a whole directory of about 160 files compressed into a single Zip archive. I've downloaded Zip and I'm trying to use it but the help you get when just using "EX zip" isn't a lot of use. My simple brain needs an example so I can get on with it.

I've been using Q-emulator by the way, so haven't needed to get involved with unzip, although that seems simpler to use.

I've tried variants along the lines of:

EX mdv2_zip,"mdv3_test","mdv1_"

Where zip is located on mdv2_, the destination file to be created will be mdv3_test, and the directory to be compressed is mdv1_
That gets an "in use" error.

EX mdv2_zip;"mdv3_test","mdv1_"

gives "bad parameter"

So dice so far.

Any ideas where I'm going wrong?

Cheers,
Alan


User avatar
desin
Brittle Membrane
Posts: 102
Joined: Mon May 10, 2021 10:33 am

Re: Struggling with Zip

Post by desin »

first of all rename your zip executable to zip_exe just to rule out any confusion
second use the ramdisks
syntax
from the zip23x_readme
ex zip;'ram1_test flp1_*'
for my own i use
ex zip_exe;'ram1_test ram2_temp ram3_*'

Hope it helps

Greetings from Switzerland
Markus
Last edited by desin on Sun Mar 09, 2025 12:25 pm, edited 1 time in total.


User avatar
dilwyn
Mr QL
Posts: 3031
Joined: Wed Dec 01, 2010 10:39 pm

Re: Struggling with Zip

Post by dilwyn »

The syntax of zip commands can be hard to get used to, more like Linux/Unix than QDOS.

EX ZIP;'zipFileName_zip win1_directory list of files to zip or wildcard'

Since that is almost meaningless to me, here's a short BASIC program which asks
1. Zip up files from which drive/directory
2. Filename of the zip file to be created or added to
3. Enter name of drive/directory holding the zip program itself

Code: Select all

100 REMark aid to using ZIP program
110 REMark needs EW command or equivalent
120 CLS : CLS #0
130 INPUT #0,'Zip up files from    > ';zipfrom$
140 IF zipfrom$ = '' THEN STOP
150 INPUT #0,'Filename of zip file > ';zipfile$
160 IF zipfile$ = '' THEN STOP
170 INPUT #0,'Zip program is on    > ';zipdrive$
180 :
190 PRINT #0,'Starting Zip program...'
200 EW zipdrive$&'zip';'-9 '&zipfile$&' '&zipfrom$&'*'
210 PRINT#0,'Program finished.'
A couple of notes:
the -9 in line 200 can be omitted, it just makes it work harder to compress better.
the '*' in line 200 is a wildcard - it means copy everything from the drive/directory named in the string zipfrom$

Example. Assume we are compressing everything from win1_games_ into a zip file called ram1_games_zip. And your ZIP program is on win1_

The command to enter in SuperBASIC would be

EX win1_zip;"ram1_games_zip win1_games_*"
doesn't matter if you use single quotes or double quotes. Must be a space before win1_games_ and no space before the asterisk.

If you don't want to zip up all the files, you can replace win1_games_* with a list of specific filenames, e.g.

EX win1_zip;"ram1_games_zip win1_games_mygame_bas win1_games_joebloggs_exe win1_games_jewels_sav"

EDIT:sorry Markus, didn't spot you'd replied first!


User avatar
Sebright
ROM Dongle
Posts: 12
Joined: Fri Feb 07, 2025 9:55 am

Re: Struggling with Zip

Post by Sebright »

Brilliant, thanks so much guys! :D


User avatar
NormanDunbar
Forum Moderator
Posts: 2423
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Struggling with Zip

Post by NormanDunbar »

There is a utility called ACP which makes compressing and uncompressing simple. It's a Pointer Environment front end to zip, arc, etc. it obviously needs those programs available, at least the one you want to use.

I use it all the time to create and unpack compressed archives.

HTH


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
dilwyn
Mr QL
Posts: 3031
Joined: Wed Dec 01, 2010 10:39 pm

Re: Struggling with Zip

Post by dilwyn »

Not to mention my very own Zip Manager :geek: https://dilwyn.theqlforum.com/arch/zipman.zip
Zip Manager
Zip Manager


User avatar
NormanDunbar
Forum Moderator
Posts: 2423
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Struggling with Zip

Post by NormanDunbar »

Looking at the image there Dilwyn, I have a feeling I'll be converting from ACP to ZipManager when I get home from Fife!

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply