Advertisement

06.15.2005 at 09:07AM PDT, ID: 21459109
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

CFFILE gets cannot access file because used by another process

Asked by smodesitt in ColdFusion Application Server

Tags: , , , ,

We have recently changed servers from CF 5 to CF MX 7.  I am currently having a problem that I believe is tied to the switch.  We also changed from Windows Server 2000 to Windows Server 2003 so it may be related to that.

Here is what is happening:

We have a form that is submitted; the output from the form is encrypted by calling gpg.exe.  This creates a file with an .asc extension.  Then, the file is read to be put into an email message:

<CFIF FileExists(output_file)>
  <CFFILE
      ACTION="Read"
      FILE="#output_file#"
      VARIABLE="output">
</CFIF>

Apparently, the gpg resource is not releasing the ownership of the file in time.  Sometimes the read works and sometimes it doesn't but it is erroring out more than it is successful.

The error I am getting is:
An error occurred when performing a file operation Read on file c:\gnupg\6776223171724094161.asc. The cause of this exception was: java.io.FileNotFoundException: c:\gnupg\6776223171724094161.asc (The process cannot access the file because it is being used by another process).

I check and the file is the location listed.

I added a cflock around the gpg call to see if it would hold the resource until it was done.  Currently the call looks like this:
<cflock timeout="50"
  throwontimeout="No"
  name="EncryptFile"
  type="EXCLUSIVE">

  <CFEXECUTE
      NAME="#gnupg_bin_path#gpg.exe"
      ARGUMENTS="-a --always-trust -r #ListChangeDelims(recipient," -r ")# --homedir #gnupg_bin_path# -e #temp_file#"
      TIMEOUT="#cfexecute_timeout#">
 </CFEXECUTE>
</cflock>

I could add a loop to pass time but am wondering if there is a more definitive way to see if the resource is released or another way to read the file and get its contents (I thought about copying the file but wasn't sure that would work either).

Thank you in advance on any help that can be provided - this is very urgent as the client needs the form submittals working asap.Start Free Trial
 
Loading Advertisement...
 
[+][-]06.15.2005 at 09:11AM PDT, ID: 14222943

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.15.2005 at 09:20AM PDT, ID: 14223042

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.15.2005 at 09:36AM PDT, ID: 14223185

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.15.2005 at 09:53AM PDT, ID: 14223350

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.15.2005 at 10:55AM PDT, ID: 14224008

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.15.2005 at 11:00AM PDT, ID: 14224065

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: ColdFusion Application Server
Tags: process, file, another, used, access
Sign Up Now!
Solution Provided By: black0ps
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.15.2005 at 01:20PM PDT, ID: 14225453

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.15.2005 at 01:32PM PDT, ID: 14225569

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42