ZLib_Add

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > ZLIB >

ZLib_Add

 

Description

 

Create and add files into a compressed Zip file.

 

Syntax

 

n = ZLib_Add(sZipFile, sFileToAdd)

 

Returns

 

Number.

0 (zero) means success

<> 0 means error (see error code)

 

Parameters

 

Name

Type

Optional

Meaning

sZipFile

String

No

Full path name of the compressed Zip file to be created

sFileToAdd

String

No

Full path name of the file to be added into compressed Zip file

 

Remarks

 

IMPORTANT: The first time this function is executed:

if compressed Zip does not exists, file will be created

if compressed Zip archive already exists, file will be DELETED

 

This function must be executed repeatedly for all files that must be added into compressed Zip file.

Call this function with empty strings to close the compressed Zip file.

 

Example on how to use the function:

First call: ZLib_Add( "testzip.zip", "test1.txt" ) - zipfile is created, file is added

Next call: ZLib_Add( "testzip.zip", "test2.txt" ) - second file is added

...

Last call: ZLib_Add(     "",           "" ) - zipfile is closed

 

Restrictions

 

IMPORTANT: The first time this function is executed:

if compressed Zip does not exists, file will be created

if compressed Zip archive already exists, file will be DELETED

 

See also

 

ZLib_AddEx, ZLib_List, ZLib_Extract, ZLib_Find,

 

Examples