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!
Deletion from ZIP files "fixes" headers
Moderators: Hacker, petermad, Stefan2, white
Re: Deletion from ZIP files "fixes" headers
Why should TC zip write an illegal structure
only for the reason that there is already an error in the file.
only for the reason that there is already an error in the file.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Deletion from ZIP files "fixes" headers
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.
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
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Deletion from ZIP files "fixes" headers
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
https://www.ghisler.com
Re: Deletion from ZIP files "fixes" headers
Is there a way to preserve the current header by simply copying the current values? I imagine that's a more "accurate" implementation, without any assumptions.ghisler(Author) wrote: 2023-03-24, 14:57 UTC 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.