$zip » History » Revision 11
Revision 10 (Per Amundsen, 01/10/2023 12:51 AM) → Revision 11/12 (Per Amundsen, 02/23/2023 07:58 PM)
_Added in 2.9_ *$zip* Returns the name of the zip operation during a [[on ZIP]] or [[on UNZIP]] event. ---------------- *$zip(name, [N])* Returns information about a zip/unzip item during a [[on ZIP]] or [[on UNZIP]] event. _See also [[/zip]], [[$ziperr]], [[on ZIP]], [[on UNZIP]]._ *Parameters* table(ktable). |*Parameter*|*Description*| | name | - Name of the zip/unzip operation. (can be a [[Scripting_Wildcards<notextile>|</notextile>wildcard]]) | [[Scripting_Wildcards|wildcard]]) | [N] | - The Nth matches name. | *Properties* table(ktable). |*Property*|*Description*| | .name | - Returns the name of zip/unzip operation. | | .src | - Returns the source file or folder. | | .dest | - Returns the destination file or folder. | | .ratio | - Returns 0, 1 or 2 where 0 = no compression, 1 = fastest compression, 2 = optimal compression. | | .unzip | - Returns [[$true]] if this is a unzip operation, otherwise [[$false]]. | *Example* <pre> ; Zip the entire adiirc folder into 'adiirc.zip' //zip name $qt($adiircdir) adiirc.zip ; Print the zip result when then zip operation is finished. on *:ZIP:name:echo -ag zipped $zip($zip).src into $zip($zip).dest status: $iif($ziperr,fail,ok) </pre> ----------------------------- *$zip(file.zip,cetlpo,file|dir,password,N)* Create or extract zip files. Returns "1" if the operation was successful, otherwise "0". *Parameters* table(ktable). |*Parameter*|*Description*| | file.zip | - The zip file to list/test/create or extract. | cetlpo: | c | - Create a new zip file. | | e | - Extract a zip file. | | t | - Test a zip file. | | l | - List number of files in a zip file or the Nth file. | | p | - *TODO* | | o | - Overwrite existing zip file or extract folder. | | file<notextile>|</notextile>dir | file|dir - File or directory to zip or directory to extract to. | | password | - *TODO* | | N | - Used with the "l", if N = 0, number of zipped files in the zip file, otherwise the Nth zipped file. | *Properties* table(ktable). |*Property*|*Description*| | .csize | - Returns the compressed size of the file. *(AdiIRC Only)* | | .size | - Returns the size of the file. | | .mtime | - Returns the last modification time of the file. | *Example* <pre> ; Creates a new zip file called 'file.zip' and adds the file 'file,txt'. //echo -ag $zip(file.zip, c, file.txt) ; Creates a new zip file called 'file.zip' and adds the folder 'folder'. //echo -ag $zip(file.zip, c, folder) ; Extracts the zip file 'file.zip' to the folder 'extracted'. //echo -ag $zip(file.zip, e, extracted) ; Prints number of zipped files in the zip file 'file.zip'. //echo -ag $zip(file.zip, l, 0) ; Prints the file name of the first zipped file in the zip file 'file.zip'. //echo -ag $zip(file.zip, l, 1) </pre>