Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

UnZipMBS.Close
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Close a ZipFile.
Notes:
Use CloseCurrentFile to close any open file before using Close.
Lasterror is UnZipOK on success.

Feedback, Comments & Corrections

UnZipMBS.CloseCurrentFile
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Close the file in the zip archive opened with OpenCurrentFile.
Notes: Lasterror is set to UnzipCRCError if all the file was read but the CRC was not correct.

Feedback, Comments & Corrections

UnZipMBS.Comment as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Get the global comment string of the ZipFile.

Feedback, Comments & Corrections

UnZipMBS.CommentSize as UInt32
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Size of the global comment of the zipfile.

Feedback, Comments & Corrections

UnZipMBS.Constructor(data as memoryblock)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 10.5 Yes Yes Yes Yes No
Function: Open a Zip file from data in the memoryblock.
Notes:
The Handle property is zero on failure and not zero on success.
The memory block must have a known size.

See also:

Feedback, Comments & Corrections

UnZipMBS.Constructor(data as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 10.5 Yes Yes Yes Yes No
Function: Open a Zip file from data in the string.
Notes: The Handle property is zero on failure and not zero on success.

See also:

Feedback, Comments & Corrections

UnZipMBS.Constructor(file as folderitem)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Open a Zip file from a file.
Notes:
The Handle property is zero on failure and not zero on success.

If you run this class in a thread, please make sure your thread has a big stack (1 MB or more). Else it will crash.

See also:

Feedback, Comments & Corrections

UnZipMBS.Constructor(file as folderitem, Offset as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 11.0 Yes Yes Yes Yes No
Function: Open a Zip file from a file starting at the offset.
Notes: The Handle property is zero on failure and not zero on success.

See also:

Feedback, Comments & Corrections

UnZipMBS.Count as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Total number of entries in the zip archive.
Notes: This value is stored in the zip archive as 16 bit integer, so maximum value is 65535. The plugin can extract more files than that number.

Feedback, Comments & Corrections

UnZipMBS.EOF as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Returns 1 if you are on the end of a file.
Notes: This is not to test whether you are on the end of the zip archive.

Feedback, Comments & Corrections

UnZipMBS.ExtractFiles(DestFolder as FolderItem, ExtractWithoutPath as boolean = false, Overwrite as Boolean = false, Password as String = "", byref ErrorMessage as String) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 16.0 Yes Yes Yes Yes No
Function: Simple function to extract all files from archive into folder.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.zip")

dim folder as FolderItem = SpecialFolder.Desktop.Child("test")
folder.CreateAsFolder

dim u as new UnZipMBS(f)
dim error as string
if u.ExtractFiles(folder, error) then
MsgBox "OK"
else
MsgBox "Error: "+error
end if
Notes:
DestFolder: Destination folder.
ExtractWithoutPath: If true, all files are put in one folder.
Overwrite: Whether to allow overwriting files.
Password: The password to decrypt files.
ErrorMessage: An english error message.

Returns true on success or false on failure.
This function does not restore file permissions or other metadata.
And it may not work with non ASCII characters.

If you need more control over files being extracted, stored or error checking, please use example projects coming with plugin.

Feedback, Comments & Corrections

UnZipMBS.FileInfo as UnZipFileInfoMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Queries file information for the current file.
Notes: Returns nil on any error.

Feedback, Comments & Corrections

UnZipMBS.FileName as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: The filename of the current open file.
Notes:
This name has no text encoding defined, as the plugin has no idea what text encoding was used. You may need to define the text encoding as being ASCII, Windows, MacRoman or whatever, when you work with this file name.
This name may include path components for folders.

Feedback, Comments & Corrections

UnZipMBS.FilePosition as UnZipFilePositionMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: The current file position.
Notes:
You can read or set the current file you edit.
(Read and Write computed property)

Feedback, Comments & Corrections

UnZipMBS.GetLocalExtrafield as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Read extra field from the current file (opened by unzOpenCurrentFile)
Notes: This is the local-header version of the extra field (sometimes, there is more info in the local-header version than in the central-header)

Feedback, Comments & Corrections

UnZipMBS.GoToFirstFile
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Set the current file of the zipfile to the first file.
Notes: Lasterror is UnzipOk on success.

Feedback, Comments & Corrections

UnZipMBS.GoToNextFile
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Set the current file of the zipfile to the next file.
Notes: Lasterror is UnzipOk if there is no problem and UnzipEndOfListError if the actual file was the latest.

Feedback, Comments & Corrections

UnZipMBS.LocateFile(filename as string, CaseSensitive as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Try locate the file filename in the zipfile.
Example:
// open zip archive
dim f as FolderItem=SpecialFolder.Desktop.Child("test.zip")
dim z as new UnZipMBS(f)

// let's search the file
z.LocateFile "test.rtf",2

if z.Lasterror = z.UnzipOk then
dim info as UnZipFileInfoMBS = z.FileInfo
MsgBox "OK: "+str(info.UncompressedSize)+" bytes"
else
MsgBox "Failed."
end if
Notes:
For the CaseSensitivity signification, see CompareFileNames. Text encoding must match the text encoding of the files.

Lasterror is UnzipOk if the file is found. It becomes the current file, UnzipEndOfListError if the file is not found.

Feedback, Comments & Corrections

UnZipMBS.Offset as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Get or set the current index of the file in the zip directory.
Notes:
If you set this value, you basicly move to another file.
(Read and Write computed property)

Feedback, Comments & Corrections

UnZipMBS.OpenCurrentFile(byref method as Integer, byref level as Integer, raw as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Same than OpenCurrentFile, but opens file for reading raw data (not uncompressed).
Notes:
if raw=true the file data is returned uncompressed. If raw is false, it is decompressed for you.
Method will receive the method of compression.
level will receive the level of compression.

See also:

Feedback, Comments & Corrections

UnZipMBS.OpenCurrentFile(byref method as Integer, byref level as Integer, raw as boolean, password as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Same than OpenCurrentFile, but opens file for reading raw data (not uncompressed) and with a password.
Notes:
if raw=true the file data is returned uncompressed. If raw is false, it is decompressed for you.
Method will receive the method of compression.
level will receive the level of compression.

See also:

Feedback, Comments & Corrections

UnZipMBS.OpenCurrentFile(password as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Open for reading data the current file in the zipfile.
Notes: password is a crypting password.

See also:

Feedback, Comments & Corrections

UnZipMBS.Position as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Returns the current position in uncompressed data.

Feedback, Comments & Corrections

UnZipMBS.Position2 as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 11.1 Yes Yes Yes Yes No
Function: Returns the current position in compressed data.
Notes: This property is useful to show progressbar with progress over reading the original zip file.

Feedback, Comments & Corrections

UnZipMBS.ReadCurrentFile(size as Integer) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Compression MBS Compression Plugin 8.6 Yes Yes Yes Yes No
Function: Read bytes from the current file (opened by OpenCurrentFile).
Notes: Returns "" on any error or on file end.

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins