mUnzip is a .zip decompressing DLL for mIRC, by Kamek, based on Info-ZIP's Unzip program source.
mUnzip works with signals (introducted in mIRC 6.0) to let the script interact with the DLL.
The Unzip function syntax is: Unzip [-flags] [signal] [pattern] <zip file> <output path>
For example: //echo -a $dll(mUnzip.dll, Unzip, -dS mysignal C:\MyFile.zip "C:\Extract dir\"
Where the flags are:
Behavior flags | |
You can use only one of these flags at a time | |
-o | Always overwrite files |
-E | Extract only newer files (skip replacing files that are older than your local files) |
If you don't specify any of the flags above, a replacing signal will be sent. | |
Informational flags | |
-t | Test zip file (test integrity without extracting) |
-v | List all the files that are available, but without extracting |
-z | Show zip file comment |
-Z | Shows extensive information about the specified archive (beware, you'll be FLOODED with information) |
Other flags | |
-d | Use the specified folder names (keep the same dir structure from the zip file, highly recommended) |
-M | Custom wildmask pattern: a pattern will specify which files should be extracted. Currently, only one pattern is allowed (you can't, for example, use *.txt;*.exe). |
-Qn | Makes the operation more quiet: -Q1 echoes few information, -Q2 hides any echo signals |
-S | Custom signal name: right after the flags, you'll need to specify a suffix for the signal. |
You shouldn't use any behavior or informational flag at the same time, and shouldn't mix behavior and informational flags. -d and -Qn don't work with the information flags. Also, please note that, even when you're just using one of the informational flags, you still need to specify a target directory (valid or not).
The function will either return a success or an error code.
Success codes are in the format S_OK |+[status flags], where [status flags] can contain w if some minor wrong thing happened (for example, a file that couldn't be extracted because it needed a password) or c if the zip file has a comment.
If you use the -v flag, however, the returned value will have some more information:
S_OK |+[status flags]|<total compressed size> <total decompressed size> <avg compression ratio>|<total number of files>
The error codes are in the format E_[name] [description], where [name] is a small name for the error (that will remain constant) and [description] is a human-readable description. For example: E_INVPARM Invalid parameters.
mUnzip uses signals to communicate with mIRC and interact with the script. The format of a signal is: on *:SIGNAL:<signal>:<code>
If you don't specify any custom signal name (-S flag), it will be mUnzip. If you do, it will be mUnzip_suffix (like mUnzip_Sample).
When a signal is called, $1 corresponds to the "event" that can be handled and $2- corresponds to the parameters.
The following are the supported events:
The DLLInfo function returns some information about the DLL. You don't really need any parameters.
Example of use: //echo -a $dll(mUnzip.dll, DLLInfo, .)
The code I made for DLL is actually just an interface for the wonderful work the people from Info-ZIP made in their Unzip application. If you want to know more about Info-ZIP, you should visit http://www.info-zip.org/.