zip_file_replace command is compressing the data when the compression is set to store uncompressed #483
Replies: 2 comments
-
If you explicitly set the compression method after replacing the data, that should be honoured. Seems like a bug in libzip, we'll look into it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
We fixed this in 4205915 but never mentioned it here - doing that now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am investigating using libzip to create and modify files containing chunks of data. In my test case my chunks of data are vectors of doubles. I want to create an archive file and at a later date be able to read one of the files from the archive, modify it and replace it with updated data.
I create a zipfile with one directory and within this directory are 10 files containing my data.
I create the file using the following code and it correctly contains all the data uncompressed. (I have removed all error checking for brevity.)
I then open this file and replace the 3rd file of data (data2.bin) with new data using the following code:
When I open the archive in Windows explorer the updated file in the archive has been compressed.
I have tried replacing the compression type with ZIP_CM_DEFAULT; if I do this just in the file replace code then it makes no difference, if I set it in both the file create and the file replace code then when the file is replaced all the files in my archive are compressed.
I have verified the index I am passing to the zip_file_replace() and zip_set_file_compression() functions is the same and the correct index for the file being replaced.
I don't get any errors returned from any of the calls to the libzip functions.
If anyone knows what I am doing wrong or if I am missing a step which will allow me to replace files in an existing archive and set the compression to uncompressed I would really appreciate your help.
Thanks, Kate
Beta Was this translation helpful? Give feedback.
All reactions