|
MsgPlus::ExtractFromZIP
The MsgPlus::ExtractFromZIP function extracts files from
a ZIP archive. Encrypted ZIP files are supported and file patterns
can be used to specify what to extract.
Syntax
[boolean] ExtractFromZIP(
[string] ZipFile,
[string] DestDirectory,
[string] FileNames,
[string,optional] Password
);
Parameters
- ZipFile
- [string] Full path of the ZIP archive file.
- DestDirectory
- [string] Path of a directory where the files will be extracted.
The directory must exist.
- FileNames
- [string] One or more file name patterns specifying what files
to extract. Wildcard characters can be used. See remarks.
- Password
- [string,optional] Password to use if the archive is
encrypted.
Return Value
A boolean value specifying if the operation succeeded. The
function returns true if at least one
file was extracted. Here is a list of possible reasons why this
function may return false:
- The specified ZipFile does not
exist.
- The specified DestDirectory is
empty.
- No files were extracted from the ZIP file even though the call
succeeded.
- Not enough system resources to complete the operation.
Remarks
To extract all the files from an archive, specify "*.*" for the
FileNames parameter. If needed, more
than one file name can be specified in this parameter, each one
separated by a space character. To specify a file name that
contains a space itself, enclose the file name in double quotes.
Examples:
- "*.jpg"
- "file1.dat file2.dat"
- "*.jpg *.gif pics*.*"
- "file1.dat \"long file name.dat\""
Because the call is made synchronously, you should avoid using
this function on ZIP archive files that are relatively large
(bigger than 20MB). Doing so may give the impression to the user
that Messenger froze and Messenger may be disconnected from the
server.
Function Information
| Object |
MsgPlus |
| Availability |
Messenger Plus! Live 4.60 |
See Also
MsgPlus Object.
|