Zip and unZip files and directories: Difference between revisions

From Cuis CookBook
Jump to navigation Jump to search
(imported material)
(No difference)

Revision as of 22:14, 4 May 2025

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