title: Copy directory content
body: <p>I want to copy the content o directory(tmp1) to another directory(tmp2). tmp1 may contain files and others directories. I want to copy the content of tmp1 (including the mode) using C/C++. If tmp1 contains a tree of directories I want to copy them recursively.</p>
  
  <p>What is the simplest solution?</p>
  
  <p>I found a solution to open the directory and read every entry and copy it with <code>cp</code> command. Any simpler solutions?</p>