Contents - Index - Previous - Next


ZipComment property

 

Applies to

TVCLUnZip component

 

Declaration

property ZipComment: string;

 

Description

The ZipComment property returns the zipfile's comment if there is one.  For 16 bit (Delphi 1) no more than 255 characters of the comment are returned.  

 

You may (as of version 2.19) simply set the ZipComment property directly, before calling any of the Zip methods when either creating a new zip file, or when adding or updating an existing zip file.  For instance: 

 

With VCLZip1 do 

begin 

ZipName := 'c:\mydir\MyArchive.ZIP'; 

ZipComment := 'This is a comment'; 

FilesList.Add('c:\test\*.*'); FilesList.Add('c:\backups\*.*); Zip; 

end; 

 

If all you want to do is modify or add a zip comment for an existing archive (not zipping any additional files) then you should call the SaveModifiedZipFile Method to save the archive with the new ZipComment.  

Something like the following: 

 

With VCLZip1 do 

begin 

ZipName := 'c:\mydir\MyArchive.ZIP'; 

ReadZip; 

ZipComment := 'This is a comment'; 

SaveModifiedZipFile; 

end; 

 

Keep in mind that you cannot add or modify a zip comment for an existing spanned or blocked archive. You cannot modify spanned or blocked archives in any way once they have been created.  

 

Run-time only