I'm writing a program for work that needs to copy a file from a directory on one drive to another, e.g. from a flash drive to the hard drive. Originally I had planned on simply opening the file and using fread to read through the file and then using fwrite to "recreate" the file on the new drive. That code worked fine, but it doesn't do well for large files. A friend suggested using a system call to copy and paste the file from one drive to the other, but everything I'm finding on it refers to UNIX environments and there are several different examples. Since this program will only ever be used on Windows machines can I still use this system call idea and if I can, would you mind giving me some example code of where to start. From the White Bible to Google I've seen enough code that I've managed to confuse myself royally.
This is the code I have right now.
Thank you for your help!Code:FILE *in; FILE *out fopen=in("E:\\folderA\\%s"fileA, "rb") //fileA is a *char[] fopen=out("C:\\folderB\\fileB", "wb+") /*System Call to copy paste This is where I originally had my fread command and my fwrite command. */ fclose(in); fclose(out);
Matrixaffiliate