This document describes the public methods and usage examples for the Zip Parent Script.
Summary of Public Methods
Details of Public Methods
mGetArchiveContents |
| Syntax | | mGetArchiveContents object me, string filename
|
| Returns | | A list of property lists if successful. If not successful, returns an error code (use mGetErrorMsg to determine the error message) e.g., returns [ [ proplist for file1 ], [ proplist for file 2], etc ] The property list for each file contains the following properties: | Property | Variable Type | Example | | #arc_filesize | integer | 147986 | | #arc_filedate | string | "25-05-2002" (dd-mm-yyyy) | | #arc_filetime | string | "14:35:05" (hh:mm:ss) | | #arc_folder | string | "folder1/folder2/" | | #arc_filename | string | "myfilename.ext | |
| Description | | Creates a new instance of the script and assigns it to the specified file. The specified is opened with the given accessMode. | Argument | | Description | | filename | | This should contain the full path and filename of the ZIP archive. | |
| Example | | Read the directory contents of the ZIP file located in c:\temp\myfile.zip. |
sFile = "c:\temp\myfile.zip"
lFiles = script("Zip Parent").mGetArchiveContents(sFile)
if (lFiles.ilk <> #list) then sErrorMsg = script("Zip Parent").mGetErrorMsg(lFiles) put "Error occurred:" & sErrorMsg
else repeat with i = 1 to lFiles.count put i && lFiles[i][#arc_filename] end repeat end if
|
mInterface |
| Syntax | | mInterface object me |
| Returns | | 0 |
| Description | | Outputs a list of public handlers for this script to the messagewindow. |
mGetErrorMsg |
| Syntax | | mGetErrorMsg object me, integer ErrorNumber
|
| Returns | | String of the error message for the given error number. If no error number is supplied, a list of all error numbers and messages is returned. |
| Description | | If an error code is returned by mGetArchiveContents, use this method to determine the specific error which occurred. | Argument | | Description | | ErrorNumber | | If this parameter is not supplied, a list of all error messages will be returned. | |
| Example | | Determine the error message for error number -997. |
put script("Zip Archive Parent").mGetErrorMsg(-997)
-- "(-997) ConvertData Xtra not present" |
List of Error Codes
| Error Number | | Error Message |
| -1 | | Error opening file |
| -2 | | Error getting filesize |
| -3 | | Error setting file position |
| -4 | | Error reading from file |
| -5 | | Couldn't find end of central directory record |
| -6 | | Error seeking to start of central directory |
| -7 | | Error matching central directory signature |
| -997 | | ConvertData Xtra not present |
| -998 | | BinaryIO Xtra not present |
| -999 | | Could not get valid instance of BinaryIO Xtra |