Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:57:50+00:00 2026-06-02T03:57:50+00:00

I am trying to delete and recreate a test file, but am getting the

  • 0

I am trying to delete and recreate a test file, but am getting the error below. Can anyone tell me why this is happening?

Error:

ColdFusion could not delete the file e:\sample\test2.html for an unknown reason.

Code:

<cfif FileExists("e:\sample\test2.html")>
   <cffile action="delete"file="e:\sample\test2.html"><br>
   <p>deleted the file </p>
<cfelse>
   <p>Sorry, can't delete the file - it doesn't exist.</p>
</cfif>

<cfset createObject("java", "java.lang.Thread").sleep(JavaCast("int", 90000))>
<cfsavecontent variable="HTML">
    <cfinclude template="noticeEmail.cfm">
</cfsavecontent>        

<cffile action="WRITE"  attributes = "normal" nameconflict="Overwrite"  
      file="e:\sample\test2.html" output="#HTML#">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:57:52+00:00Added an answer on June 2, 2026 at 3:57 am

    The first thing I would check is permissions for the user that ColdFusion is running as.
    I don’t know how you’re running CF or in what sort of environment you’re on but assuming that this is a local development environment, are on a windows machine and are running ColdFusion as a service:

    • Find the ColdFusion service in the services manager (start -> run ->
      services.msc)
    • Right click on the ColdFusion Service and look in the log on tab to find “who this is running as. (the service could be named several things depending on how it is installed but
      look for “ColdFusion 9 Application Server”, Anything starting with
      JRun or Macromedia)
    • If this isn’t local system then you’ll need to confirm that the user has read / write access to e:\sample\test2.html

    Other things that could cause errors, could another program have this file locked, what is happening with the file after it is created (is it only created through ColdFusion)

    Also could you post the actual error that you are receiving?
    If it’s “Sorry, can’t delete the file – it doesn’t exist.” Then this is due to the check you’ve got at the top to confirm if the file exists.

    Finally the code that you’ve pasted above appears to have the first character missing from every line, it would be worth fixing this so that others can more easily copy and paste the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to delete an unmapped class/record via the NHibernate sql api. But can't seem
I am getting the following error msg when I am trying to delete a
I'm trying to recreate the database from a new schema, but I keep getting
I am trying to delete a cookie with this function , but it doesnt
I am trying to delete all but the 10 most recent directories, always excluding
I am trying to delete a line from a text file in java, I
I'm trying to write an SQL query for my program, but I just can't
Just trying to delete all the documents, and did this: http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E then committed: http://localhost:8983/solr/update?stream.body=%3Ccommit/%3E
I'm trying to delete a specific line by id from a file in C++
I'm trying to delete certain lines from a file. My file is a .txt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.