zLib ZIP archive access interface
Description

This interface can read, write, create, or file in source from ZIP archive files in Visual Smalltalk.  This is ideal for applications that handle ZIP archive information or need compress or decompress data in memory.

Files

zLib.SLL  zLib interface 
support library.
zLib.DLL  Support DLL
zLib.st
zLib.pol
zLib.prj
Current.Project
Source files

Requirements

VS/VSE 3.1.2 for Win32s. Requires the following libraries:
 
ARBase.sll Alejandro Reimondo base components SLL 
ARAddins.sll SelfDefinedStructures support

Installation

Ensure the libraries including zlib.dll above are copied in the VS/VSE library directory or a directory that appears in the Windows PATH statement.  To load all required libraries in VisualSmalltalk evaluate:

#('ARBase' 'ARAddIns' 'zlib')
        do:[:lib|SmalltalkLibraryBinder bindTo:lib].

Examples

Evaluate the following expressions to demonstrate ZIP file operations in Visual Smalltalk.  See also the example expressions in file Current.Project.

"Open the zip file 312wd1.zip in the current directory and display some statistics"
lib := ZLibLibrary openRead:'312wd1.zip'.
"Evaluate with show it"
lib fileNames.         "List the file names in the archive"
lib numberOfEntries.   "List the number of file names in the archive"
contents := lib contentsOf: 'upgrade/partug.txt'. "Access the contents of the file named"
lib close.

"Create a zip file if it doesn't exist and add a new file to the archive"
lib := ZLibLibrary openWrite:'testZip.zip'.
lib createFile:'test.txt'.
lib write:'Test for zLib interface'.
lib closeFile. "test.txt"
lib close.     "textZip.zip"
 

Contact

Alejandro F. Reimondo
Amenabar 3476 Piso: 2 Dto: B.
Ciudad de Buenos Aires.
Argentina.
Tel: (54)-1-703-5586.
aleReimondo@sugarWeb.com
http://www.sugarweb.com


Links to:
The ObjectShare web site
VisualSmalltalk Product Support
ObjectShare's Online Documentation Site