-
copy directory in C
Hi all,
Does anyone have any C programming sample code or links to some that would show me how to copy a directory (& all its files) from 1 location to another on a Windows machine? I don't need to open or manipulate the directory in any way, just to copy it to a new location using an absolute path. I am a complete newbie to C programming, so any help would be appreciated.
-
Okay, so I've gotten the copy part to work with the following code:
{
system("copy C:\\MYDOCU~1 C:\\test");
}
But there is a problem. The folder MYDOCU~1 has sub-folders within it that are not being copied over. How do I modify or alter the code above to ensure that the folders are copied over to the new location as well as the files?
-
system("xcopy C:\\MYDOCU~1 C:\\test /e/v/s");
-
Scarlet7,
Thanks so much! I made a few changes to your modifiers for xcopy, but otherwise it works perfect.
-Dbyte