Page 1 of 1

Struggling with Zip

Posted: Sun Mar 09, 2025 10:53 am
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

Re: Struggling with Zip

Posted: Sun Mar 09, 2025 11:31 am
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

Re: Struggling with Zip

Posted: Sun Mar 09, 2025 11:36 am
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!

Re: Struggling with Zip

Posted: Sun Mar 09, 2025 11:53 am
by Sebright
Brilliant, thanks so much guys! :D

Re: Struggling with Zip

Posted: Sun Mar 09, 2025 6:31 pm
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.

Re: Struggling with Zip

Posted: Sun Mar 09, 2025 7:14 pm
by dilwyn
Not to mention my very own Zip Manager :geek: https://dilwyn.theqlforum.com/arch/zipman.zip
Zip Manager
Zip Manager

Re: Struggling with Zip

Posted: Mon Mar 10, 2025 6:46 am
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.