2

My object is to compress a directory containing multiple files using Minizip to .zip archive. I tried reading the documentation provided with Minizip along with the example, but I couldn't comprehend it.

Do I go about it by creating a zip file using zipOpen, and then just add files to the zip file using zipOpenNewFileInZip ? Something like this:

zipFile Compressed = zipOpen("Name", APPEND_STATUS_CREATEAFTER);
    int rt = zipOpenNewFileInZip(Compressed," What should I put here?" , &zfi, NULL, 0, NULL, 0, "", 0, Z_DEFAULT_COMPRESSION);

Please help me understand what functions I need to do my objective.

Thank you.

  • http://stackoverflow.com/questions/11370908/how-do-i-use-minizip-on-zlib – Retired Ninja Nov 19 '13 at 00:46
  • I have checked that example. I have a question: In the zipOpenNewFile, what should I put as the second parameter, the directory of the file I want to compress(add to the zip)? – user2844838 Nov 19 '13 at 00:50
  • As the linked question points out, and the name of the parameter to the function you can see in `zip.h` it is expecting a filename. – Retired Ninja Nov 19 '13 at 00:56
  • 1
    How does it guarantee that the file is there, meaning where should the file be placed for it to function correctly? – user2844838 Nov 19 '13 at 00:58

0 Answers0