title: How do I zip a directory or multple files with zlib, using C/C++?
body: <p>I did search for this topic, but I didn't find any relevant clue for this. </p>
  
  <p>Can anyone give me some tips or demo code that can solve the problem?</p>
  
  <p>Thanks in advance.</p>
  
  <p>---FYI---</p>
  
  <p><strong>What I wanna do here is to zip files and upload to remote PC.
  I think it'll take the following steps:</strong></p>
  
  <p>a) initialize a zipped file head and send to remote PC and save that zipped file head.</p>
  
  <p>b) open file to read a portion of file data and zip the file data locally.</p>
  
  <p>c) send zipped data through a pipe (tcp or udp for example)  to remote PC.</p>
  
  <p>d) save the data from pipe, which is zipped, on the remote PC.</p>
  
  <p>e) if there are multiple files, come back to b)</p>
  
  <p>e) when all files is zipped and transferred to remote PC, then close zipped file.</p>
  
  <p>Two question here:</p>
  
  <p>a) compress/decompress</p>
  
  <p>b) File format</p>
  
  <p>Thanks guys!</p>