Background copy in threads
Posted on 1998-04-29
the goal is to copy files in the background.
I have an app on which you can drop files. I don't want the
app, to freeze, when it copies files. I want to be capable to
drop other files on it, even when there is still a file or files
So I thought of using a thead, but I'm not very avare on how it is working.
Anyway I'm to lazy to search about how it is working.
Here is my copy function:
procedure copyFichier(const source, dest: string);
S, D: TFileStream;
S := TFileStream.Create(source, fmOpenRead or fmShareDenyWrite);
D := TFileStream.Create(dest, fmCreate or fmOpenWrite or fmShareExclusive);
It is not very important, to have it anyway.
it is called in the middle of another of my procedures:
I want that copy to happen in background, how can I do that ?
I need a counter of how many copy are still active.
I want working source code please.
Thanks for your help.