Name
zip.SetFileCompression -- set file compression
Synopsis
zip.SetFileCompression(id, idx, method[, flags])
Function
This function sets the compression method for the file at index idx in the zip archive specified by id to the compression method specified in method. The optional flags argument can be used to define the compression level, 1 being fastest compression and 9 highest. Allowed values are 1-9 or 0 to use the compressor's default setting.

The method parameter must be one of the following constants:

#ZIP_CM_DEFAULT:
This is the default setting. Currently the same as #ZIP_CM_DEFLATE.

#ZIP_CM_STORE:
Store the file uncompressed.

#ZIP_CM_BZIP2:
Compress the file using the bzip2 algorithm.

#ZIP_CM_DEFLATE:
Deflate the file with the zlib algorithm and default options.

Note that only #ZIP_CM_DEFLATE and #ZIP_CM_STORE can be assumed to be universally supported.

Also note that the change to the zip archive isn't done immediately but is postponed until you call zip.CloseArchive().

Inputs
id
identifier of the zip archive to use
idx
index of file whose compression should be set
method
desired compression method (see above)
flags
optional: desired compression level ranging from 1 (fastest) to 9 (highest) or 0 for the compressor's default setting (defaults to 0)

Show TOC