title: Using rsync programmatically in c++
body: <p>I am using <a href="https://linux.die.net/man/1/rsync" rel="nofollow noreferrer">rsync</a> command-line tool to transfer files from a source folder to a destination folder as follows:</p>
  
  <pre><code>rsync -r  /source_folder /destination_folder
  </code></pre>
  
  <p>How can this be done programmatically in c++? I have looked into <a href="https://github.com/librsync/librsync" rel="nofollow noreferrer">librync</a>, which is supposed to do this. But i think it is not very well documented and dosent have examples to show how to sync two folders. Also I am looking for a way to do this preferably without using system()/popen().</p>
  
  <p>Is there any other way to do this in c++? 
  Thanks in advance!</p>