Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:02 05 Dec 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : zip, unzip, gzip and tar apps for the PicoMite and CMM2

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12327
Posted: 09:23am 04 Dec 2026
Copy link to clipboard 
Print this post

New: zip, unzip, gzip and tar for the PicoMite and the Colour Maximite 2

Four new loadable programs bring archives to MMBasic: zip and unzip for .zip files, gzip for .gz, and tar for .tar and .tar.gz. Unpack a .zip or a .tar.gz you have just downloaded with curl, put the whole of A: into one file as a backup, send a folder of programs to a friend as one file, or squeeze a big log file, all at the prompt or from a BASIC program. They are named after the tools they copy and take the commonest of their options, so what you know from a PC works here.

They run on the PicoMitePC3, PicoMiteHDMIUSB (with its PSRAM enabled) and PicoMitePicoCalc firmware, V8.00.00b6 or later, and on every Colour Maximite 2 with firmware 7.00.00RC2 or later. Each is tiny: 36 to 52 KB.

RUN "B:/zip/zip.app", "-r B:/backup.zip A:/*"
RUN "B:/zip/unzip.app", "B:/games.zip -d B:/games"
RUN "B:/zip/tar.app", "-xzvf B:/project.tar.gz -C B:/project"
RUN "B:/zip/gzip.app", "-d B:/log.txt.gz"



What they do
• zip makes an archive, or adds to one: -r goes into folders, -u updates only what is new or newer, -d deletes entries, -x leaves names out, -j drops the folders, -0 to -9 trade speed for size. A short BASIC program that compressing would only make bigger is stored as it is, as Info-ZIP's zip does.
• unzip lists (-l, -v), tests every CRC (-t), shows a text file on the screen (-p) or extracts, into a folder of your choice with -d. Names after the archive's choose what is extracted: "games.zip *.bas".
• gzip compresses and decompresses (-d), tests (-t) and lists (-l). As elsewhere it deletes the file it has done, unless you give -k.
• tar creates (-c), lists (-t) and extracts (-x), with gzip by -z, and in or into another folder with -C. It reads the pax format of GitHub's downloads and GNU's long names, and finds out for itself whether an archive is compressed. The letters can go without the dash, as czvf.
• Names may have * and ? in their last part, as FILES takes them, and -h lists each program's options.


Safe to use
• Ctrl-C stops any of them and leaves nothing half written. zip builds the new archive beside the old one and puts it in place only when it is complete, so an error or Ctrl-C leaves your old archive exactly as it was; unzip, gzip and tar remove the file they were writing.
• unzip asks before it overwrites a file: yes, no, all or none (-o and -n answer for you).
• A name in an archive that would go outside the folder you are extracting into, such as ../x or /x, is refused, so a harmful archive cannot write where it should not.
• A damaged archive is reported, file by file, and MMBasic gives the program's exit code: 1 for warnings, 2 for an error, 130 for Ctrl-C.


Tested both ways
Archives made by a PC (zip, tar.gz in pax format, GNU tar, gzip) were unpacked on a PicoComputer 3, and all but the GNU tar on a PicoCalc too, and the archives the two made were checked byte for byte against the originals on the PC, so what you make on the PicoMite opens anywhere and what you download opens on the PicoMite. With 1.3 MB of files of all kinds, zip took 4.4 s and unzip 3.1 s on a PicoComputer 3, and 3.4 s and 2.0 s on a PicoCalc at 436 MHz.


Installing
PicoMite: the four programs are in the zip folder of PicoMite_Programs-8.00.00b6.zip, on the PicoMite's V8.00.00b6 release, updated on 4 December: https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V8.00.00b6  . The PicoMite App User Guide, with a new chapter on them, is in the release's supplementary manuals zip.
Colour Maximite 2: they are in the zip folder of CMM2_Programs_8.00.00b7.zip, on the Colour Maximite 2's 8.00.00b7 release, updated on 4 December: https://github.com/UKTailwind/CMM2V1.5/releases/tag/v8.00.00b7  . The Colour Maximite 2 App User Guide, with the new chapter, is beside it on the release.
Neither firmware has changed, so if you already have it, just download those zips again. Copy the zip folder to the root of the SD card (A:/zip on the Colour Maximite 2) with a card reader, or by TFTP, which keeps a file's exact size (XMODEM pads it, and RUN then refuses it).


What they do not do
• Extracted files have the time they were written, not the archive's, and on the PicoMite files on its flash A: go into an archive with the current time: the firmware cannot yet set a file's date.
• A path, folder and name together, can have at most 127 characters, as in BASIC: extract an archive with very long names into a folder near the root.
• No passwords or encryption, no bzip2, xz or LZMA, and no .7z or .rar.


The Colour Maximite 2
The same four programs, built from the same source with the CMM2's own SDK, run on every generation with firmware 7.00.00RC2 or later (Installing, above, says where they are). They were tested on a Generation 3 with 8.00.00b7, where 1.3 MB zipped in 2.3 s and unzipped in 1.9 s. On the CMM2, RUN takes the options as typed rather than as a string: RUN "A:/zip/zip.app", -r backup games/*.


Licences and source
The programs are under the MIT licence. They are built on miniz 3.1.2 by Rich Geldreich and others, also MIT, which does the compressing and decompressing; thanks to its authors. Their source is apps/zip in the firmware's repository, https://github.com/UKTailwind/PicoMite , which fetches miniz from its release.

 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1207
Posted: 06:40pm 04 Dec 2026
Copy link to clipboard 
Print this post

What did I type at the end of my UnZip release posting?
  Quote  (Maybe a more full featured loadable app will magically appear. )

If only I could predict stock prices as well...  
Visit Vegipete's *Mite Library for cool programs.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 2182
Posted: 08:02pm 04 Dec 2026
Copy link to clipboard 
Print this post

  vegipete said  What did I type at the end of my UnZip release posting?
  Quote  (Maybe a more full featured loadable app will magically appear. )

If only I could predict stock prices as well...  


   

In fact, I almost asked about zipping....better I wait  
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026