Zip and unZip files and directories

From Cuis CookBook
Revision as of 22:17, 4 May 2025 by Nmingott (talk | contribs) (imported material + synt hilight)
(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