idx = zip.AddFile(id, f$[, table])
f$to the zip archive specified by
idand returns the index of the newly added file. The optional table argument allows you to specify further options.
The following tags are currently recognized by the optional table argument:
NewNameis omitted, the file will always be stored in the root directory of the zip archive.
If you specify the
Encryption tag, it is also necessary to provide a
password that is needed to decrypt the file. You can specify this
password in the
Password tag (see below). If you don't use the
tag, the default password set using zip.SetDefaultPassword() is
Encryptiontag has been set to a value different from
#ZIP_EM_NONE(see above), this tag can be set to a password that should be used to protect the file. If you omit this tag, the default password set using zip.SetDefaultPassword() is used.
Note that only
#ZIP_CM_STORE can be assumed to be universally
When specifying this tag, you can also pass the
to set the compression level (see below).
f$. If you'd like to assign a different datestamp to the file, then you need to pass a string in the standard Hollywood date format of
dd-mmm-yyyy hh:mm:ssto this tag.
Note that this function doesn't immediately begin compressing the file and
writing it to the zip archive. Instead, the file is just added into an
internal list and compressing and writing will be done once you call
zip.CloseArchive(). This means that you have to make sure that the
file you specified in
f$ is still available when you call zip.CloseArchive(),
i.e. in case you pass the name of a temporary file to
f$ you must not delete
this temporary file before you call zip.CloseArchive().