Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearing the general purpose flag #440

Closed
wuanne15 opened this issue Dec 30, 2019 · 1 comment
Closed

Clearing the general purpose flag #440

wuanne15 opened this issue Dec 30, 2019 · 1 comment
Labels
fixed Issue or bug has been fixed new feature New feature

Comments

@wuanne15
Copy link

wuanne15 commented Dec 30, 2019

Hi!
I’ve been working on moving my code from version 1.1 of mini zip to version 2.8.9, but I’ve been encountering some issues. Currently my code reads the length of a file from the file header. The problem is that the local header file in the zip file no longer has the uncompressed size of the file, but instead the file descriptor contains it. I read in appnotes.txt that if the 3rd bit of the general purpose flags is set then the CRC-32 and uncompressed size fields are set to be zero in the local header and the correct values are put in the data descriptor and central directory. I checked the hexdump of the newly generated zip file, and the 3rd bit of the general purpose flag is indeed set. Thus I was wondering how I can disable this so that the uncompressed file size and crc-32 data are contained in the local header file instead of the data descriptors.

I'm using the function zipWriteInFileInZip.

Thanks so much!

nmoinvaz added a commit that referenced this issue Jan 4, 2020
…iptor prevents having to seek backwards or to another disk while writing. However, the local header files aren't updated with the crc or size values. #440
@nmoinvaz
Copy link
Member

nmoinvaz commented Jan 4, 2020

I have made a commit that will allow you to set call mz_zip_set_data_descriptor(handle, 0) in the dev branch.

nmoinvaz added a commit that referenced this issue Jan 4, 2020
…iptor prevents having to seek backwards or to another disk while writing. However, the local headers aren't updated with the crc or size values. #440
@nmoinvaz nmoinvaz closed this as completed Jan 5, 2020
@nmoinvaz nmoinvaz added 2.0 fixed Issue or bug has been fixed new feature New feature labels Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issue or bug has been fixed new feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants