Why not:
<cfif FileExists("location_of_my_file")>
<cffile .......>
</cfif>
--
Billy Cravens
[EMAIL PROTECTED]
"DeVoil, Nick" wrote:
>
> One way - just do the <CFFILE ACTION="Delete"> but put a CFTRY/CFCATCH
> round it to trap the error in case the file doesn't exist.
>
> Nick
>
> -----Original Message-----
> From: Jim Watkins [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 06, 2000 2:39 PM
> To: CF-Talk
> Subject: Checking and deleting files
>
> Can someone help me on checking for and then deleting a file?
> I need to check to see if the file 'output.xls' exists and then if it does
> delete it. Currently I use following but seems to be rather crude:
>
> <CFFILE ACTION="Write" FILE="d:\templates\output.xls" Output="Contents">
> <CFFILE ACTION="Delete"FILE="d:\templates\output.xls">
>
> Jim Watkins
> http://www.ngtcollege.org
>
> ----------------------------------------------------------------------------
> --------------------
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
> message with 'unsubscribe' in the body to [EMAIL PROTECTED]
>
> **********************************************************************
> Information in this email is confidential and may be privileged.
> It is intended for the addressee only. If you have received it in error,
> please notify the sender immediately and delete it from your system.
> You should not otherwise copy it, retransmit it or use or disclose its
> contents to anyone.
> Thank you for your co-operation.
> **********************************************************************
>
>------------------------------------------------------------------------------------------------
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
>with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]