Save()
Previous  Top  Next

:Save() - Save the Zip File.

Syntax

:Save([<cZipFileComment>]) --> lSaved  

Parameters

<cZipFileComment>  
<cZipFileComment> optionally specifies the value of the (Global) Zip File Comment to be saved.  
It defaults to the current value of the instance variable :FileComment.  

Returns

This method returns .T. (TRUE) if the file's Central Directory was successfully saved, and .F. (FALSE) if it could not (or did not need to) be saved.  

Description

This method saves (or updates) the Central Directory of the Zip File, including the optional (Global) Zip File Comment, and writes it to disc. If the Central Directory has not been saved, the Zip File will appear to be empty or corrupt!  
 
The (Global) Zip File Comment, which will also be stored in the instance variable :FileComment, is not compressed and is simply added to the Zip File's Central Directory, increasing the size of the Zip File by its length. The maximum length of a (Global) Zip File Comment is (0xFFFF) or 65535 characters.  
 
The :Save() method is also automatically called if a modified Zip File is closed with the :Close() method, or if (another) Zip File is opened with either the :New() or the :Open() method.  

Example

Save the (Central Directory of the) currently open Zip File, including a new (Global) Zip File Comment:  
 
oZip:Save('File was last updated by Andreas Gehrs-Pahl')