Archived Forum Post

Index of archived forum posts

Question:

Is there a function which tells me that the ZIP is 'dirty'/changed?

Mar 13 '16 at 12:29

Hi,

I don't want to call WriteAndClose (Chilkat ZIP) is not necessary. How can i tell if any actions on the ZIP actually changed the ZIP? Is there a 'dirty' property?

Thank you.


Answer

Perhaps you can just set your own flag whenever you call any methods that would modify a ZIP - if it's True then call WriteAndClose, otherwise skip WriteZipAndClose.

Another option would be to cache values like FileCount, Entry FileNames and CRCs, etc.. when you open the Zip. Before calling WriteZipAndClose, compare the cached values to the current values and only call WriteZipAndClose if there's a difference.