UnZipMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

UnZipMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Compression MBS Compression Plugin 8.6 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A class to decompress a zip archive.
Example
// open zip archive
dim f as FolderItem=SpecialFolder.Desktop.Child("test.zip")
dim z as new UnZipMBS(f)

// let's start
z.GoToFirstFile
do

// get details on this file:
dim info as UnZipFileInfoMBS = z.FileInfo
dim name as string = z.FileName

if left(name,8) <> "__MACOSX" then // ignore Mac special files for metadata
z.OpenCurrentFile
if z.Lasterror=0 then

// create output file (if you want to support folders, this needs to be changed. See other examples)
dim outfile as folderitem = GetFolderItem(Name)
dim b as BinaryStream = BinaryStream.Create(outfile, true)
dim s as string

// now read 100 KB chunks and write them to new file
do
s=z.ReadCurrentFile(100000)
b.Write s
loop until lenb(s)=0


// cleanup
b.Close
z.CloseCurrentFile

end if
end if

// move to next file until we reach the end
z.GoToNextFile
loop until z.Lasterror<>0

This is a simple class which uses zlib and has some limitations:


See also ArchiveReaderMBS and ArchiveWriterMBS classes for more features and compression formats.

Constants

Constant Value Description
CompressionBestCompression 9 One of the compression level constants.
CompressionBestSpeed 1 One of the compression level constants.
CompressionDefault -1 One of the compression level constants.
CompressionNo 0 One of the compression level constants.
MethodDeflated 8 One of the compression methods.
MethodNone 0 One of the compression methods.
StrategyDefault 0 One of the strategy constants.
StrategyFiltered 1 One of the strategy constants.
StrategyFixed 4 One of the strategy constants.
StrategyHuffmanOnly 2 One of the strategy constants.
StrategyRLE 3 One of the strategy constants.
UnzipBadUnZipFile -103 One of the error constants.
UnzipCRCError -105 One of the error constants.
UnzipEndOfListError -100 One of the error constants.
UnzipInternalError -104 One of the error constants.
UnzipOk 0 One of the error constants.
UnzipParameterError -102 One of the error constants.

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes


The items on this page are in the following plugins: MBS Compression Plugin.


UnZipFilePositionMBS   -   UpDownArrows


💬 Ask a question or report a problem