Board index » delphi » copying files from a diroctory

copying files from a diroctory

want to copy all files in a directory into another.
can anybody help?
have to detect files in the folder and copy them.

thnx..

 

Re:copying files from a diroctory


Of the top of my head.

You can "find" all the filenames using the FindFirst and then FindNext
functions.
For each filename you copy it using blockread and blockwrite.
Remember FindClose at the end.

There might be a SH... function you can call, but I do not remember.

Med venlig hilsen / Best regards
Morten Ingvordsen
Denmark

Quote
"repairer" <aq...@meridyen.ws> wrote in message

news:3a81b394$1@news.turk.net...
Quote
> want to copy all files in a directory into another.
> can anybody help?
> have to detect files in the folder and copy them.

> thnx..

Re:copying files from a diroctory


The function is called SHFileOperation (see Win32.hlp) and it is definitely
easier than what you are describing.

"Morten Voigt Ingvordsen" <120100751...@esenet.dk> schreef in bericht
news:96b90e$iae$1@news.inet.tele.dk...

Quote
> Of the top of my head.

> You can "find" all the filenames using the FindFirst and then FindNext
> functions.
> For each filename you copy it using blockread and blockwrite.
> Remember FindClose at the end.

> There might be a SH... function you can call, but I do not remember.

> Med venlig hilsen / Best regards
> Morten Ingvordsen
> Denmark

> "repairer" <aq...@meridyen.ws> wrote in message
> news:3a81b394$1@news.turk.net...
> > want to copy all files in a directory into another.
> > can anybody help?
> > have to detect files in the folder and copy them.

> > thnx..

Re:copying files from a diroctory


maybe you should read the dc help, search for CopyFile

Quote
"repairer" <aq...@meridyen.ws> wrote in message

news:3a81b394$1@news.turk.net...
Quote
> want to copy all files in a directory into another.
> can anybody help?
> have to detect files in the folder and copy them.

> thnx..

Re:copying files from a diroctory


CopyFile(SrcFile,DestFile: PChar) I think, cant remember the unit though...

Morten Voigt Ingvordsen <120100751...@esenet.dk> wrote in message
news:96b90e$iae$1@news.inet.tele.dk...

Quote
> Of the top of my head.

> You can "find" all the filenames using the FindFirst and then FindNext
> functions.
> For each filename you copy it using blockread and blockwrite.
> Remember FindClose at the end.

> There might be a SH... function you can call, but I do not remember.

> Med venlig hilsen / Best regards
> Morten Ingvordsen
> Denmark

> "repairer" <aq...@meridyen.ws> wrote in message
> news:3a81b394$1@news.turk.net...
> > want to copy all files in a directory into another.
> > can anybody help?
> > have to detect files in the folder and copy them.

> > thnx..

Other Threads