Written by Frank Condello.
Feedback: developer@chaoticbox.com
Web: http://developer.chaoticbox.com/
zziplib Copyright (c) Guido Draheim
zlib Copyright (c) Jean-loup Gailly and Mark Adler
About
|
The ZZip Utilities Plugin uses the open source zzip library to extract compressed or stored files from standard zip format archives using relative path names. In its current state, the plugin only reads data from existing archives with a known file structure, and does not support modifying or creating zip archives, or browsing archive directories with unknown structures.
|
Usage Notes
|
Place the ZZip Utilities Plugin.rbx file included in the download into your REALbasic plugin folder and launch REALbasic. The plugin provides a new class called ZZipArchive and a Folderitem extension; OpenAsZZipArchive.
Folderitem.OpenAsZZipArchive Method (Folderitem class extension)
Returns a ZZipArchive class if the Folderitem points to a valid zip archive, or Nil if the file is not a zip archive. ZZipArchive instances should only be created via this method.
ZZipArchive Class Methods:
ExtractFileData(path As String) As String Returns the binary format contents of a zipped file as a String. Path is the relative posix-style path inside the zip archive. Do not precede the path with a forward slash, and note that paths are not case sensitive. Returns an empty String if an error occurred, or if the file was empty.
LastError As String Returns the last error encountered by zziplib's operations on the archive. Useful to diagnose problems when ExtractFileData returns an empty string.
Tips:
It's often useful to use a file extension other than ".zip" as a simple form of obfuscation. Common examples of disguised ZIP files are Quake 3 ".pk3" archives, and Java ".jar" files.
When extracting multiple files from an archive, it is fastest to open the ZZipArchive once, and retain the instance until you no longer need any of its files. This not only avoids unnecessary file access to the archive itself, but allows zziplib to cache the archive's directory information for faster successive extractions. Keep in mind however, that the actual archive file itself remains open as long as the ZZipArchive instance exists. |
Problems / Limitations / Quirks:
|
zziplib does not support extended ascii or unicode characters (double-byte characters) in the names of zipped files. Please see the zziplib FAQ for more information.
Some issues (including hard crashes) have been observed with Mac OS 9 applications built with ZZip Utilities using the REALbasic 200x series IDEs. These problems do not manifest when using the older REALbasic 5.5.x releases, and it is unclear whether the plugin or changes to the RB framework are to blame.
You need to know the file structure of your archives in order to extract anything useful. Retrieving the directory structure of an archive is on the "would-like" list, but it's not a priority. The plugin's intended use at this point is to allow developers to keep private and known external files in a single data container that allows fast easy access, and optional compression.
The error messages returned by zziplib may contain characters such as "%s" which are meant to be replaced proper file names, but the plugin currently does keep track of names or paths and returns the error strings wholesale when you call the ZZipArchive.LastError method. This will likely change in a future release.
|
Version History
|
v0.3 - October 13, 2006
- IMPORTANT: ZZip Utilities now requires REALbasic 5.5 or greater.
- Mac OS X: i386 support (Intel/Universal Binary targets).
- All: Updated zziplib to version 0.13.47.
- Mac OS X: No longer uses file manager routines marked deprecated in Mac OS X 10.4.
- All: Folderitem extensions use the Extends syntax rather than the older (deprecated?) REALRegisterClassExtension API.
- All: The ZZipArchive class has a more robust initializer that may prevent random errors/crashes if the class is improperly used.
- Mac OS X: Mach-O segments have significantly reduced in size.
v0.2 - August 4, 2005
- Updated zlib to version 1.2.3 (security patch).
- Native Mach-O (PPC) build (Xcode project included).
- Resovled file not found issues when running in Mac OS X's Classic environment.
- Documentation included in the plugin (available from REALbasic's "Help" menu).
v0.1 - September 2, 2003
- Initial release.
|
|