House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

Wait for File to Get Written

Author:
Mary Jo Sminkey
05/29/2012 07:04 PM

I've run into this a number of times the last few months and couldn't find anything in the archives that really seemed to address it. It's a common enough issue that I'm sure people have dealt with it, and I'm curious what solutions you might use. Basically I have situations where I need to wait for ColdFusion to finish creating a file before displaying it. The legacy code I'm working with using a cfexecute to run an executable file, and it uses this code snippet: <cfloop condition="NOT FileExists(theFileName)"></cfloop> <cfinclude template="viewFile.cfm"> So basically it loops until it finds the file and then sends it down via a cfcontent tag. I'm not particularly fond of this as if for any reason the executable fails, you end up waiting for a timeout situation. In the past I've used a sleep() to just pause the page but that's not particularly ideal either. Any better options, or maybe a combination of the two? Mary Jo     


Search cf-talk

May 18, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference