Re: casual EFCreateError when uploading a file

Giganews Newsgroups
Subject: Re: casual EFCreateError when uploading a file
Posted by:  Remy Lebeau (Indy Team) (
Date: Wed, 4 Oct 2006

"Gordon Kästner" <Meta7…> wrote in message

> we use Delphi 7 und Indy 10.0.52 devsnapshot from May 2006.

That is an old version of Indy.  You should consider upgrading to Indy

> We have strange and rare problems uploading files.
> Sometimes a file just can not be "created". The FTP raises
> SFCreateErrorEx (could not create file...) w/ syserror 32 (file used
> by another process) in TFileStream.Create in Classes.pas (Line 5114).

Well, there is your answer then.  You are trying to create a file that
already exists and is in use elsewhere, so TFileStream can't override it.

> The File then exists on the drive but is 0 byte large

The file is not created at all when that error occurs.  The file had to have
already existed beforehand.

> and locked by SYSTEM Process.

Is your code running inside a service, by chance?  If not, then do you have
any anti-virus or hard drive maintanance programs running at the time of the

> We have to close the Resource under "Shared Folders" in
> "Computer Management" first to delete the file and retry.

There is your answer then.  The file really is in use - by Windows itself
when the remote folder containing the file is displayed onscreen.  There is
nothing you can do about that, other than to save the file onto the local
machine first, and the copy it to the destination machine afterwards.



In response to

casual EFCreateError when uploading a file posted by Gordon_Kästner on Wed, 04 Oct 2006