Coming into this thread late....
But I suggest that the two segments of problematic
code in the parent window and the child window both be
enclosed within a named cflock like name="arexcelr"
(if you haven't already done this)
--- Jack Tumlin <[EMAIL PROTECTED]> wrote:
> Try your suggestion and still having the same
> results.
>
> The error message I'm getting is:
>
> "The process cannot access the file because it is
> being used by another
> process. (error 32)"
>
>
> Jack Tumlin
> Vice President Business Development
> Millennium Software, Inc.
> The Software Solutions Company
> [EMAIL PROTECTED]
> www.millsoftinc.com
>
>
> At 04:36 PM 9/20/2001 -0500, you wrote:
> >Renaming a file takes some time. I'm not sure how
> the internals of CF
> >work - does it send the renaming command off to
> Windows and then carry
> >on it merry way? If so, it may be trying to delete
> a file that doesn't
> >exist *yet* at that point in time.
> >
> >An idea: let a custom tag do the deleting - if the
> file exists, it gets
> >deleted; otherwise, it trys again.
> >
> ><cflock name="arexcelr" type="exclusive"
> timeout="10">
> ><cfif FileExists("e:\inetpub\wwwroot\app\junk.txt")
> is "Yes">
> > <cffile action="RENAME"
> source="e:\inetpub\wwwroot\app\junk.txt"
> >
> >destination="e:\inetpub\wwwroot\app\junk.del">
> > <cf_deleteFile
> file="e:\inetpub\wwwroot\app\junk.del">
> ></cfif>
> ></cflock>
> >
> >The file, deleteFile.cfm:
> ><cfif fileExists(attributes.file)>
> > <cffile action="DELETE"
> file="e:\inetpub\wwwroot\app\junk.del">
> ><cfelse>
> > <cf_deleteFile file="#attributes.file#">
> ></cfif>
> >
> >
> >---
> >Billy Cravens
> >Web Development, EDS
> >[EMAIL PROTECTED]
> >
> >
> >-----Original Message-----
> >From: Jack Tumlin
> [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, September 20, 2001 3:01 PM
> >To: CF-Talk
> >Subject: Problem with CFFILE
> >
> >
> >I having a problem with a piece of code that checks
> for the existence of
> >a
> >file, renames the file, and then deletes the file.
> The code is run in a
> >child window after the user clicks the submit
> button on the parent
> >window.
> >The problem occurs when a user closes the child
> window while the thread
> >is
> >running and then clicks the submit button on the
> parent window again.
> >
> >The message appears on the NT Server saying that
> the file is missing. I
> >have tracked it down to the cffile action="RENAME"
> statement in the code
> >
> >below. It appears that the first thread is still
> processing the delete
> >when
> >the second thread is checking for the existence of
> the file. The first
> >thread then finishes and the second thread tries to
> rename the now
> >non-existence file and the error occurs.
> >
> >Is there something I'm missing with the CFLOCK
> statement. Also, this is
> >not
> >happening all the time. There is some sort of
> timing issue. I have read
> >where a delete on a NT Server does not happen right
> away. So, my
> >question
> >has anybody run into a similar problem and came up
> with a fix?
> >
> >Here is the code:
> >
> ><cflock name="arexcelr" type="exclusive"
> timeout="10">
> ><cfif FileExists("e:\inetpub\wwwroot\app\junk.txt")
> is "Yes">
> > <cffile action="RENAME"
> source="e:\inetpub\wwwroot\app\junk.txt"
> >
> >destination="e:\inetpub\wwwroot\app\junk.del">
> > <cffile action="DELETE"
> file="e:\inetpub\wwwroot\app\junk.del">
> ></cfif>
> ></cflock>
> >
> >
> >Thanks,
> >
> >Jack Tumlin
> >Vice President Business Development
> >Millennium Software, Inc.
> >The Software Solutions Company
> >[EMAIL PROTECTED]
> >www.millsoftinc.com
=====
I-Lin Kuo
Macromedia CF5 Advanced Developer
Sun Certified Java 2 Programmer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists