<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > ZLIB > ZLib_AddEx |
Description
Open or create a compressed Zip file for adding files into it.
Syntax
n = ZLib_AddEx(sZipFile, sFileToAdd [, Flags])
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 |
sFileToAdd |
String |
No |
Full path name of the file to be added into compressed Zip file |
Flags |
Number |
Yes |
%ZIP_CLOSE Archive is closed after file is added %ZIP_PATH Add path to file (on unzipping path will be recreated) %ZIP_REL_PATH Save this as relative base path (relative root is taken from first call to function)
More Flags can be indicated with OR |
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 added to it
This function must be executed repeatedly for all files that must be added into compressed Zip file.
Call this function with %ZIP_CLOSE flag to close the compressed Zip file.
Example on how to use the function:
•First call: ZLib_AddEx( "test1", "testzip.zip" ) - zipfile is created, file is added
•Next call: ZLib_AddEx( "test2", "testzip.zip", %ZIP_CLOSE ) - second file is added, file 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 added to it
See also
ZLib_Add, ZLib_List, ZLib_Extract, ZLib_Find,
Examples