ZipObject
[Desktop Automation]
This object is used for creating/managing ZIP compressed archives.
Properties
Property | Read/write | Type | Description |
---|---|---|---|
Count | read-only | Number | Number of files in the open ZIP archive. Only available in archives opened for reading |
Canread | read-only | Boolean | Flag indicating whether the archive can be read from. Only functions marked in green are available if this flag is set |
Canwrite | read-only | Boolean | Flag indicating whether the archive can be written to. Only functions marked in yellow are available if this flag is set |
password | read/write | String | Password of the ZIP archive. |
Methods
Availability of ZipObject methods depends on how the object was created.
ZipObjects from createzip()
Name | Syntax | Description |
---|---|---|
addstring | ZipObject:addstring(stringtoadd:string, zipname:string); | Adds stringtoadd to ZipObject as zipname |
addfile | ZipObject:addfile(filetoadd:string, zipname:string); | Adds filetoadd to ZipObject as zipname |
addtext | ZipObject:addtext(texttoadd:Lua Textfile object, zipname:string); | Adds texttoadd to ZipObject as zipname |
addxml | ZipObject:addxml(xmltoadd:Lua XML object, zipname:string); | Adds xmltoadd object to ZipObject as zipname |
exportfile | ZipObject:exportfile(filename:string); | Exports the ZipObject as filename . File cannot be changed afterwards by API. |
ZipObjects from openzip()
Name | Syntax | Description |
---|---|---|
extractfile | ZipObject:extractfile(filename: String; targetname: String) | Saves the file filename from the archive to the file targetname on the file system |
getfilename | ZipObject:getfilename(index: number) | Returns the name of the file with the index index of the open ZIP file |
getfileindex | ZipObject:getfileindex(filename: String) | Returns the index of the file with the name filename of the ZIP file |
loadimage | ZipObject:loadimage(filename: String) | Loads an image from an open ZIP file. Returns an instance of Image. |
loadjson | ZipObject:loadjson(filename: String) | Loads a JSON file from an open ZIP file. Returns an instance of Json file object. |
loadtextfile | ZipObject:loadtextfile(filename: String) | Loads a text file from an open ZIP file. Returns an instance of Text file object. |
loadxml | ZipObject:loadxml(filename: String) | Loads an XML file from an open ZIP file. Returns an instance of XML file object. |