zip.CloseArchive -- close zip archive
zip.CloseArchive(id[, discard, callback, userdata])
This function closes the specified zip archive. Note that if the zip archive has been opened for writing, zip.CloseArchive() marks the point when compressing and writing the data will actually happen. That's why it can take some time for this function to return.

If you want to discard all changes that have been made to the zip archive, you have to pass True in the discard parameter. In that case, the original zip archive isn't modified and all changes are discarded. This is also what will happen to all zip archives which you open using zip.OpenArchive() but forget to close using zip.CloseArchive(). Changes will only ever be written to the zip archive if you explicitly call zip.CloseArchive() with discard being False.

If you'd like to monitor the progress of compressing data and writing it to the zip archive, you can pass a callback function in the second parameter. Optionally, it is also possible to specify user data to pass to the callback function in their third argument. The userdata parameter can take values of any type: Numbers, strings, tables, and even functions can be passed as user data.

The status callback function receives a single table element that contains the following fields:

Initialized to "CloseArchive".

Contains the identifier of the zip archive that is currently being worked on.

Contains a value between 0 and 100 indicating how much work has already been done.

Contains the value you passed in the userdata argument.

Obviously, if discard is set to True, the callback function will never be called.

identifier of the zip archive to be closed
optional: True to discard all changes, False to write all changes to the zip archive (defaults to False)
optional: function to call from time to time
optional: user specific data to pass to callback function

Show TOC