title: C/C++ Copy file with automatic recursive folder/directory creation
body: <p>In Win32 API, there is <a href="http://msdn.microsoft.com/en-us/library/aa363851(VS.85).aspx" rel="nofollow noreferrer">CopyFile</a> that literally copies a file. However, this API doesn't create folders. For example, I'd like to copy <code>C:\Data\output.txt</code> to <code>D:\Temp\Data\output.txt</code>. But, the target folders, <code>D:\Temp</code> and <code>D:\Temp\Data</code>', do not exist. In this case, this API just fails.</p>
  
  <p>Is there a handy API that can automatically and recursively create directory structure on copy? Definitely, I can make such function, but I expect someone already made the function.</p>