?
Solved

CFILE ACTION ="READ" error 32

Posted on 2003-10-27
5
Medium Priority
?
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9627705
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
ID: 9628679
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
ID: 10165479
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
ID: 11006604
PAQed, with points refunded (40)

PashaMod
Community Support Moderator
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

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