Deletion from ZIP files "fixes" headers

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
stranger
New Member
New Member
Posts: 1
Joined: 2023-03-23, 01:07 UTC

Deletion from ZIP files "fixes" headers

Post by *stranger »

Hi,

Some ZIP files that were created by older ZIP programs might have a mismatch between the local file header and the central directory header.
When deleting a file through TC from such a ZIP file, TC "corrects" the headers of *all* files in the zip to have the local file headers align with the central directory headers.
I assume updating a ZIP file should have the very minimum impact on the file, and only the requested changes should be executed, so TC seems to be doing more than it should.

Thanks!
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6429
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Deletion from ZIP files "fixes" headers

Post by *Horst.Epp »

Why should TC zip write an illegal structure
only for the reason that there is already an error in the file.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3296)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: Deletion from ZIP files "fixes" headers

Post by *sqa_wizard »

To be more detailed:
You cannot just delete a file from a ZIP directly !
The ZIP has to be unpacked completely first and packed again without the file.
This way a correct header is written again.
#5767 Personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Deletion from ZIP files "fixes" headers

Post by *ghisler(Author) »

No, it doesn't have to be unpacked completely. TC creates a new temporary ZIP file and copies all not deleted files from the old to the new ZIP file. It copies the compressed data and doesn't unpack and then re-pack the data. But since it has to create a new ZIP, it creates it with correct headers.
Author of Total Commander
https://www.ghisler.com
Post Reply