Can anyone direct me to this function?
Thanks,
André
BOOL CopyFile(
LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
tom
A. Scholberg <scho...@bluewin.ch> schrieb in im Newsbeitrag:
3A486F77...@bluewin.ch...
Use either the CopyFile API or ShFileOperation (in ShellAPI).
--
Regards
Ralph (TeamB)
===
CopyFile( pchar(myFileNameVar), pchar( destFileNamePathVar), false);
Copies the file myFileNameVar to destFileNamePathVar and does not fail if
the file already exists, instead it is overwritten.
Also, there is a Delphi utility unit in the examples that has a Dlephi
CopyFile(..) method. You can find it in:
..\Borland\Delphi5\Demos\Doc\Filmanex\fmxUtils.pas
I kind of remember something buggy about the fmxUtils.CopyFile(..) routine,
but I can't remember what it is. I've been using the Windows.CopyFile(..)
for so long I've forgotten. It's just as easy. :)
"Thomas" <Thom...@gmx.ch> wrote in message
news:92a03d$jb...@bornews.inprise.com...
I do wish however that our Delphi doc were more self contained...
André
FS1, FS2: TFileStream;
begin
try
FS1:= TFileStream.Create(FromFile,fmRead or fmShareDenyNone); //
"fmShareDenyWrite" to be sure someone doesn't write to the file while your
copying it
FS2:= TFileStream.Create(ToFile,fmCreate or fmShareExclusive);
FS2.CopyFrom(FS1,0);
finally
if assigned(FS1) then FS1.Free;
if assigned(FS2) then FS2.Free;
end;
end;
--
Greatings,
Ronald Hoek
Applicationdevelopper
ComponentAgro B.V.
Barendrecht
Phone. +31-180-621306
Fax. +31-180-611797
mailto:ho...@componentagro.nl
http://www.componentagro.nl
A. Scholberg <scho...@bluewin.ch> schreef in berichtnieuws
3A486F77...@bluewin.ch...