In Win32 API, there is CopyFile that literally copies a file. However, this API doesn't create folders. For example, I'd like to copy C:\Data\output.txt
to D:\Temp\Data\output.txt
. But, the target folders, D:\Temp
and D:\Temp\Data
', do not exist. In this case, this API just fails.
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.