You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we can seen in the sources, in the case of trying to extract a single file that is not in an archive, mz_zip_reader_save_all is supposed to return MZ_END_OF_LIST error:
int32_t minizip_extract(const char *path, const char *pattern, const char *destination, const char *password, minizip_opt *options)
{
[...]
/* Save all entries in zip file to destination directory */
err = mz_zip_reader_save_all(reader, destination);
if (err == MZ_END_OF_LIST && pattern != NULL)
printf("Files matching %s not found in zip file\n", pattern);
[...]
}
For example with file ZipExample.zip containing a few files:
If I extract an existing file it actually return MZ_OK (0) but it also returns MZ_OK when trying to extract a non-existing file (and we can see that the "file matching not found" log is not printed):
I'm using your lib in a C++ project then I got a easy workaround calling boost::filesystem::is_regular_file(destinationFolder / singleFile) after extract of single file but it would be nice to have mz_zip_reader_save_all actually returning proper error in this case.
Thanks.
The text was updated successfully, but these errors were encountered:
Hi,
As we can seen in the sources, in the case of trying to extract a single file that is not in an archive, mz_zip_reader_save_all is supposed to return MZ_END_OF_LIST error:
For example with file ZipExample.zip containing a few files:
If I extract an existing file it actually return MZ_OK (0) but it also returns MZ_OK when trying to extract a non-existing file (and we can see that the "file matching not found" log is not printed):
I'm using your lib in a C++ project then I got a easy workaround calling boost::filesystem::is_regular_file(destinationFolder / singleFile) after extract of single file but it would be nice to have mz_zip_reader_save_all actually returning proper error in this case.
Thanks.
The text was updated successfully, but these errors were encountered: