J
John Rogers
I have some code that does a recursive copy of whatever folder I give to
it to copy the structure where I want it. I have it running in a single
thread
to make it a bit more efficient. So far it works good, but I am trying to
add
more directories so I can do a bulk copy.
Every article that I have read on threads have always showed two different
functions to run your two threads etc. My idea is to make a little utility
that
does the same thing as a download manager, but instead it will copy files to
different folders drives etc.
This is where I am lost on the threading issues.
I want to add every dir to a listview, lets say I have some items in a
listview.
c:\backup
c:\source
c:\drivers
c:\utils
I want to copy these items to d:\BACKUPS
Now in the listview (this is my dilemma) I want to start a filecopy of every
checked item in a different thread and copy them to the destination dir.
I know how to go through the listview to see what is checked and what is
not,
but the threading part is whats getting me lost.
Also, do I need a different routine to copy the files for each thread? I
ask this
because I do not think that I can use the same file copy routine for all of
the threads
running at the same time.
CopyFilesandDirs() etc.
I hope I explained this with enough detail, let me number a few things.
1) Go through the listview and find each checked item.
2) Copy each checked item using a different thread to the destination dir.
3) Only run about 3-4 threads at once, no more than that.
Appreciate any help guys.
John
it to copy the structure where I want it. I have it running in a single
thread
to make it a bit more efficient. So far it works good, but I am trying to
add
more directories so I can do a bulk copy.
Every article that I have read on threads have always showed two different
functions to run your two threads etc. My idea is to make a little utility
that
does the same thing as a download manager, but instead it will copy files to
different folders drives etc.
This is where I am lost on the threading issues.
I want to add every dir to a listview, lets say I have some items in a
listview.
c:\backup
c:\source
c:\drivers
c:\utils
I want to copy these items to d:\BACKUPS
Now in the listview (this is my dilemma) I want to start a filecopy of every
checked item in a different thread and copy them to the destination dir.
I know how to go through the listview to see what is checked and what is
not,
but the threading part is whats getting me lost.
Also, do I need a different routine to copy the files for each thread? I
ask this
because I do not think that I can use the same file copy routine for all of
the threads
running at the same time.
CopyFilesandDirs() etc.
I hope I explained this with enough detail, let me number a few things.
1) Go through the listview and find each checked item.
2) Copy each checked item using a different thread to the destination dir.
3) Only run about 3-4 threads at once, no more than that.
Appreciate any help guys.
John