On specifying a source folder containg n different files, and giving different destionation folders (like e:\test, g:\test, h:\test etc), the application should copy all the files to the specified output directories at a time. The code should be be in MFC
MultiThreading example for copying a set of files to different destinations in vc++. ex. c:\tst\*.* d:, e:, f:
Create a function called something like "copyfile", pass it the source file name and destination. Then for each file requested, simply launch a thread to execute the copyfile routine. I think I'm reading your request right, I guess one other interpretation is that each source file should be written to all the destination directories, in which case you can add a middle layer to handle the additional logic, or change copyfile to take an array of destinations.
pseudocode:
void copyfile(char *src, char *dest)
{
// do simple file copy here
}
int main(int argc, char *argv[])
{
foreach srcfile
beginthread(copyfile,srcfile,destdir)
}
hibiscus
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment