Zip and unZip files and directories

From Cuis CookBook
Revision as of 22:14, 4 May 2025 by Nmingott (talk | contribs) (imported material)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You need to ensure you have loaded the appropriate package, then you can follow the examples below.

Feature require: 'Compression'. 

Example-1. Unzip a *.zip file representing a directory

zipFile _ '/home/p/download/testDir.zip'.
ZipArchive new readFrom:  zipFile ; extractAllTo: '/home/p/download/testDir' asDirectoryEntry .

Example-2. See what is inside a *.zip file

zipFile _ '/home/p/download/testDir.zip'.
za _ ZipArchive new readFrom: zipFile. 
za members . 

Example-3. TODO. Zip a file or directory