@ZIP
[VDS7]
Syntax
@ZIP(COUNT, <archive>)
@ZIP(LIST, <archive>)
@ZIP(EXISTS, <archive>, <entry>)
@ZIP(ERROR)
Description
This function reads a .zip archive (see ZIP archives) without extracting it. The first parameter selects the operation:
| COUNT | Returns the number of entries in <archive>. |
| LIST | Returns the entry names, joined by the current field separator. |
| EXISTS | Returns 1 if <entry> is present in <archive>, otherwise 0. |
| ERROR | Returns the error message from the last ZIP command or @ZIP call, or empty on success. |
OK is set false if the archive cannot be read (@zip(error) aside, which always succeeds).
OK
Unchanged for error; false if the archive is missing or unreadable for the other selectors.
Example
%n = @zip(count,backup.zip)
info backup.zip contains %n entries
%i = 0
while @less(%i,%n)
REM ... process each name from @zip(list,...) ...
%i = @succ(%i)
wend
See also
- ZIP command
- @NEW function
- ZIP archives