Copyright © 2001-2019 MultiMedia Soft

ZIP.EntryAdd method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds one or more file entries to a ZIP file session previously opened through the ZIP.Open method or created through the ZIP.Create method.

 

This method only updates the ZIP session: to update or rewrite the ZIP file the ZIP.Save method would need to be called.

 

A successful call to this method will fire the ZipOperationStart event followed by a number of ZipOperationPerc events and finally by the ZipOperationDone event.

 

For further details about methods for ZIP management refer to the ZIP object.

For details about using ZIP management refer to the How to manage ZIP files tutorial.

 

 

Syntax

 

[Visual Basic]

control.ZIP.EntryAdd (

strSourcePath as String,

bRecurseDirs as enumBoolean,

bAddExtraPath as enumBoolean

) as enumErrorCodes


 

[C++]

short control.ZIP.EntryAdd (

LPCTSTR strSourcePath,

short bRecurseDirs,

short bAddExtraPath

);


 

 

Parameter

Description

 

 

strSourcePath

String representing the absolute pathname of the file(s) or folder to add to the ZIP file.

It's allowed using the "*" and "?" wildcard characters where "*" means 0 or more of any character and "?" means any single character.

bRecurseDirs

Boolean flag determining if eventual sub-directories of the given path should be traversed and added to the directory tree.

Supported values are the following:

Mnemonic constant

Value

Meaning

BOOL_FALSE

0

Eventual sub-directories are not traversed

BOOL_TRUE

1

Eventual sub-directories are traversed and contained files are added to the ZIP session

bAddExtraPath

Boolean flag determining if absolute path will be included in the zip entry filenames as relative paths.

Supported values are the following:

Mnemonic constant

Value

Meaning

BOOL_FALSE

0

The relative path of each zipped file is not added to the final entry name.

BOOL_TRUE

1

The relative path of each zipped file is added to the final entry name.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful