kuba-- / zip

A portable, simple zip library written in C
MIT License
1.42k stars 276 forks source link

Can't create zip file? #347

Closed dangdkhanh closed 5 months ago

dangdkhanh commented 5 months ago

Hi, I have a list of files in vector

C:\Users\admin\Downloads\1.doc C:\Users\admin\Downloads\2.txt C:\Users\admin\Downloads\3.txt

and let compress these files to zip at desktop: myzip.zip How should I use your code? struct zip_t* zip = zip_open(output, ZIP_DEFAULT_COMPRESSION_LEVEL, 'w'); { for (const auto& item : vec) { zip_entry_open(zip, item.c_str()); //<-add item to zip file zip_entry_close(zip) ; } zip_close(zip); } but when opening the zip, it's all empty. How I can fix this? Thank you.

dangdkhanh commented 5 months ago

The problem has been resolved. I need to take a closer look.