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\67762231717240941
61.asc. The cause of this exception was: java.io.FileNotFoundExcept
ion: c:\gnupg\67762231717240941
61.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(recipien
t," -r ")# --homedir #gnupg_bin_path# -e #temp_file#"
TIMEOUT="#cfexecute_timeou
t#">
</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