[delphizip] Re: Changing zip comment doesn't update file timestamp

  • From: Roger Aelbrecht <Roger.Aelbrecht@xxxxxxxxx>
  • To: delphizip@xxxxxxxxxxxxx
  • Date: Wed, 22 Oct 2008 15:21:44 +0200

Patrick Kolla wrote:
> A small bug report from me:
> Situation:
> When I update some zip files, I use the CRC to check whether a file
> inside has been changed. If so, I put the new version into the archive.
> At the end, I update the zip comment to reflect the "last updated"
> timestamp.
> 
> Experienced:
> Updating the zip comment changes the file contents. I then upload
> changed files comparing the filedate and filesize. Since the timestamp
> hasnt been changed, those zip files do not get uploaded. But at the same
> time, an updated MD5, which /is/ different now, gets uploaded for
> verification purposes, meaning downloads will fail.
> 
> Expected:
> Changing the zip file comment means a change of the file contents and
> thus should update the file date.
> 
> (yes, I know I should probably use more than just the file age to
> compare what to upload, but nevertheless I think the not-updated file
> timestamp is a bug ;) )
> 
> 
> -----------
> To unsubscribe from this list, send an empty e-mail 
> message to:
>   delphizip-request@xxxxxxxxxxxxx 
> and put the word unsubscribe in the subject.
> 
> 

As far as I remember this is done on purpose.
In a 'normal' zip operation the ZipComment is always added after the 
other operations are completed.
If in AddOptions the option AddZipTime is set then zip filetime needs to 
be the same as that of the newest file int he archive, changing the 
filetime when adding the comment would break that option.

To change the zip filedate/time you need to change its contents other 
than the zipcomment.

-- 
Roger Aelbrecht


-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

Other related posts: