Assuming the user copies files only by one thread, the following would be a brute force solution to this problem:
The idea is to find out which file has actually been added from the current call to the last one. If one has been added, you can safely copy all others.
To do this, I suggest you store the list of files at the end of each call. When the current file count increased compared to that previously stored file list, you know, that all files of the previous file list are finished writing and can be copied. Maintain a list of already copied files to, to easily find out, which ones you actually need to copy at each step.
Joh




Reply With Quote
Bookmarks