Reputation: 39
I'm hoping not to resort to reading and writing of every file. Isn't there any other approach to this which might be a little shorter and easier? I'm looking to do this on a linux machine.
Upvotes: 0
Views: 782
Reputation: 14863
Use system()
system() is used to invoke an operating system command from a C/C++ program.
On windows:
#include <stdlib.h>
int main()
{
return system("copy .\\CopyFrom\\* .\\CopyTo");
}
Compile and run. Voilà!
On linux you'd do something like
return system("cp ./CopyFrom/* ./CopyTo");
Upvotes: 2