I wouldn't be surprised if, even with just one copy of the code executing,
there would be a delay between when you delete and when you can write; this
would be up to the OS and I don't think CFLOCK would help.  You could
CFTRY/CFCATCH in a CFLOOP so you wouldn't have to build in a delay:

<cfset not_deleted_yet = true>
<cfloop while="not_deleted_yet">
        <cfset not_deleted_yet = false>
        <cftry>
                <!--- cffile delete     --->
                <cfcatch>
                        <cfset not_deleted_yet = true>
                </cfcatch>
        </cftry>
</cfloop>

Could you use CFFILE append instead of delete/write?  Or log to a DB which
takes care of these problems for you?

-----Original Message-----
From: Gene Kraybill [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 10, 2000 11:31 AM
To: [EMAIL PROTECTED]
Subject: RE: CFFile access problem


Good point. I've noticed that some of the file contention problems 
seem to disappear if I use a loop to introduce a brief delay between a
CFFILE Delete and 
a CFFILE Write operation on the same file. Is that to be expected, and
should CFLOCK 
solve that problem (it seems that there are still some file contention or
access 
problems).

Gene Kraybill

> from [EMAIL PROTECTED]

> It could be contention for that file by your application. You could either
> CFLOCK that CFFILE operation, or if you don't mind losing some writes you
> could use CFTRY/CFCATCH to prevent end users from seeing the error.
 
> From: Gene Kraybill [mailto:[EMAIL PROTECTED]]
 
> We have a simple logging system on one of our sites,  and occasionally see
> this error:
 
> > Error processing CFFILE
> > Error attempting to write data to
> > target file 'E:/Web/ThisSite/counter/ShowPage_8_Day10.log'.
> > Error:  The file could not be accessed.
 
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to