Solved

CFILE ACTION ="READ" error 32

Posted on 2003-10-27
5
284 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

790 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