Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Nov : CopyFile vs. Doing it yourself

www.cryer.info
Managed Newsgroup Archive

CopyFile vs. Doing it yourself

Subject:CopyFile vs. Doing it yourself
Posted by:"Barry Morris" (nospam.barry_morris@btinternet.com)
Date:Sat, 19 Nov 2005 11:03:29

Hello


I have recently found a worrying problem which leads me to suspect that the
Kernel procedure CopyFile does things a little differently to CreateFile /
WriteFile / CloseHandle (or using Delphi File Streams).


The copy is to a networked DVD using Ahead's INCD on the remote side;
running on Windows 98.


If I use my own copy routines with CreateFile / WriteFile / CloseHandle most
of the files are corrupt by the time they reach the DVD (Occasionally
causing Windows to crash), if I use CopyFile the files always arrive intact
(and a hell of a lot faster). Why is this? What does CopyFile do differently
to WriteFile? Can we emulate CopyFile programmatically?


I know I can use CopyFile, but can we trust CreateFile / WriteFile /
CloseHandle / FileStreams etc to get a file to its destination correctly?


TIA


Barry

Info

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive