Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : ShFileOperation (FO_DELETE) / DeleteFile

www.cryer.info
Managed Newsgroup Archive

ShFileOperation (FO_DELETE) / DeleteFile

Subject:ShFileOperation (FO_DELETE) / DeleteFile
Posted by:"GrosNo" (y..@doubitchouk.net)
Date:Thu, 31 Mar 2005 11:33:38

Hi all !

I know that the deletefile API doesn't wait that the filesystem REALLY
delete the file but only notify the filesystem that the file must be delete.
When I run this code on a high speed computer,

DeleteFile(myfile.txt);
FileCreate(myfile.txt);

sometimes it fail...
I know this is not a good way to work, but I'm working on a really big old
app I meet this kind of code very often .

I would like to know if there is a way to wait the file to be really delete,
or if an explicit call to an api can flush the system file operation buffer
?

Last question: Does ShFileOperation with FO_DELETE params wait the file to
be really physically deleted ?

Thanks a lot.

GrosNo

Replies:

www.cryer.info
Managed Newsgroup Archive