Solved

CFILE ACTION ="READ" error 32

Posted on 2003-10-27
5
270 Views
Last Modified: 2013-12-24
Hi,

I have a CFEXECUTE  in my code which creates  one outputfile on the server. A few steps later i've CFFILE ACTION="READ" for which I get a CF error as follows:

Error processing CFFILE.Error attempting to read c:\Inetpub\wwwroot\announcement\envl_check\2003J27512170000159377.txt.The process cann't access the file because it is being used by another process (error 32)

The error occurred while processing an element with a general identifier of (CFFILE),occupying document position (210:1) to (210:116)

Any Clue what's going wrong?

CODE is as follows:

<CFEXECUTE NAME="#Local.DirPath#\dll\wavenv.exe"    
      ARGUMENTS='-c -p1000 "#Local.DirPath#\announcement\wav_temp\#Local.FileName#"'
        OUTPUTFILE="#Local.DirPath#announcement\envl_check\#Local.AnnNewName#.txt"    
      TIMEOUT="10">
</CFEXECUTE>

<!--- Read the output from the envelope detector into a variable --->
<cffile action="READ" file="#Local.DirPath#announcement\envl_check\#Local.AnnNewName#.txt" variable="envelope_list">

Regards
Swati



0
Comment
Question by:swatis
5 Comments
 
LVL 6

Expert Comment

by:PE_CF_DEV
Comment Utility
The cffile tag is executed as soon as ColdFusion does the cfexecute. So while your wavenv.exe is creating the file still coldfusion is trying to read it.  You'll have to come up with a way to wait for that file to become available. Also you want to make sure that the exe is closing the file once it is created and done with.

On possible way of doing things (probably not the best):

<cfloop condition="proccessing eq 1">
      <cfset proccessing = 0>
      <cftry>
      <cffile action="READ" file="#Local.DirPath#announcement\envl_check\#Local.AnnNewName#.txt" variable="envelope_list">
            <cfcatch type="any">
            <cfset proccessing = 1>
            </cfcatch>
      </cftry>
</cfloop>
0
 
LVL 4

Expert Comment

by:procept
Comment Utility
Hi,

PE_CF_DEV is right about the conflict between wavenv.exe and cffile. But, the loop could go on forever if something goes wrong. Better add a time out to it:

<cfset processing=1>
<cfset start = now()>
<!--- should exit if file can be read or after 15 secs. --->
<cfloop condition="processing EQ 1 AND DateDiff("s", start, now()) LTE 15>
   <!--- rest of code like above --->
 </cfloop>

HTH,

Chris

0
 

Author Comment

by:swatis
Comment Utility
Hello
Sorry for the late relpy but the problem was with exe itself.At last found it
0
 

Accepted Solution

by:
PashaMod earned 0 total points
Comment Utility
PAQed, with points refunded (40)

PashaMod
Community Support Moderator
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Migration from IIS6 onto IIS7 6 46
Forbidden errors 5 107
wordpress limitations 4 91
Systems talking to each other 5 107
A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now