wwApi::ZipFiles (deprecated)

This function has been deprecated: Please use the wwZipArchive class instead

Zips a set of files based on a filespec into a ZIP file.This method call talks directly to the DLL bypassing the ActiveX Control.

Dependencies:
dzip32.dll in the FoxPro or Windows path.

ZipFiles(lcZipFile, lcFileList, lnCompression, llRecurseDirectories, llAdditive)

Return Value

DynaZip error code on failure - 0 on success.

  • 0-ZE_OK // success
  • 1-ZE_BUSY // can't reenter
  • 2-ZE_EOF // unexpected end of zip file
  • 3-ZE_FORM // zip file structure error
  • 4-ZE_MEM // out of memory
  • 5-ZE_LOGIC // internal logic error
  • 6-ZE_BIG // entry too large to split
  • 7-ZE_NOTE // invalid comment format
  • 8-ZE_TEST // zip test (-T) failed or out of memory
  • 9-ZE_ABORT // user cancelled
  • 10-ZE_TEMP // error using a temp file
  • 11-ZE_READ // read or seek error
  • 12-ZE_NONE // nothing to do
  • 13-ZE_NAME // missing or empty zip file
  • 14-ZE_WRITE // error writing to a file
  • 15-ZE_CREAT // couldn't open to write
  • 16-ZE_PARMS // bad control parameters
  • 17-ZE_INCOMPLETE // could not complete operation
  • 18-ZE_OPEN // could not open a specified file to read
  • 19-ZE_MEDIA // media error... disk not ready, HW r/w error, etc.
  • 20-ZE_MVPARMS // bad Multi-Volume control parameters
  • 21-ZE_MVUSAGE // Improper usage of a Multi-Volume Zip File

Parameters

lcZipFile
Zip file to create.

lcFileList
File or file list to zip up. This list can be space separated and each file entry can contain wildcards using * or ?.

Files should be fully pathed and if filenames contain spaces use " to encapsulate them.

Example: ["c:\temp files*.bin" "c:\temp files*.xml"]

lnCompression
Compression efficiency 1 light, 9 max. Default 9.

llRecurseDirectories
Recurses filespecs through lower level directories and adds full path information. Note path information is not relative since DynaZip does not support this functionality (as Winzip does).

llAdditive
if .T. adds or overrides existing files in the zip files with the specified files.

Remarks

This is a library function, not a method of the wwAPI class.

Example

*** Create zip file with DBF and FPT files
ZipFiles("c:\temp\zipfiles.zip",CURDIR() + "*.dbf " + curdir() + "*.fpt")

*** Append additional files (last logical parm)
ZipFiles("c:\temp\zipfiles.zip",CURDIR() + "*.txt",9,.T.)

See also:

West Wind Web Connection

© West Wind Technologies, 1996-2024 • Updated: 06/01/24
Comment or report problem with topic