I have been having a rather strange problem with trying to delete text files
created using the OUTPUTFILE attribute of the CFEXECUTE tag on CF 4.51,
running on Win 2k Professional.  It seems that any file I create using
CFEXECUTE gets stuck in a locked state after I try to programatically delete
it.

Here's what my app is supposed to do:

1) I use CF to create a batch file containing multiple command line commands
to run.
2) I call CFEXECUTE to run this batch file and save the results to a text
file for later debugging if needed.
3) When the database record that the batch file relates to is deleted my
cleanup code attempts to delete both the batch file and the result text
file, since they are no longer needed.

The problem is that result text file, the one created by CFEXECUTE, never
gets deleted.  If I try to delete it by hand, or even view it in notepad,
I'm told the file is in use and can not be accessed.  Cycling the CF
application service apparently frees up the text file because it disappears
as soon as I do so.  The batch files (which are created by CFFILE) are
deleted without issue.

The strange thing is that the text file is NOT locked until step 3.  In
other words, after the batch file and text file are created I can edit them
or delete them just fine, but once I initiate the cleanup code they get
stuck.  Also, I have tried deleting the files both using CFFILE and also by
creating another batch file that deletes them.  I get the same results with
both approaches.

I'm grasping at straws and hoping that someone has seen this behaviour
before... any suggestions?

Thanks in advance,
Seth Petry-Johnson
Argo Enterprise and Associates

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to