CFExecute results while an EXE is running

Greetings all,
        I'd like to know if there is a way I can have my executable return results during a CFExecute so that the user executing the can visually see the progress its making. If I understand this correctly, I want to have the CFExecute loop while this executable is running and return some results. Something similiar to the following......

<CFEXECUTE NAME="C:\blah.exe"
    OUTPUTFILE="C:\blah_progress.log"
    TIMEOUT="60">
</CFEXECUTE>

Does this look correct ? If the executable writes to blah_progress.log will CF pick it up and place it on the page while the timeout is waiting for the executable to finish ?

Suggestions are appreciated, thank you in advance
LVL 15
ComputronAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JeffHowdenCommented:
The timeout attribute on <cfexecute> will force CF to wait for it to finish processing before continuing execution of the rest of the CF template.  If you need to read, parse and/or display the contents of blah_progress.log, then use <cffile> to read the contents of the file into a variable and do what you need to do:

<cfexecute ...>

<cfscript>
  blah_progress_output = '';
</cfscript>
<cfif FileExists("C:\blah_progress.log")>
  <cffile action="read" file="C:\blah_progress.log" variable="outout">
  <cfscript>
    blah_progress_output = Trim(output);
  </cfscript>
</cfif>

0
ComputronAuthor Commented:
Thanks for answering Jeff

So you are suggesting that I omit the timeout so it doesn't block CF, and just have CF continue to read this log for progress updates ?

The entire process will only take a minute at the most I would guess. How will CF know that my CF Execute is done ? Deelte the progress log and its over ?

Is this the best way to feed results back to a page from the EXE for the user to view an in progress scenario ?
0
JeffHowdenCommented:
I misread your question.  I don't think there's any way to output the results of the call to the <cfexecute> *as* it's happening.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

RCorfmanCommented:
I would offer something that may not be worth the effort, but you can consider it. It is basically building on JeffHowden's 'proposal'.  If you have access to the program for modifications, change it to write some particular line at the end when it is completed, then redirect the output to a file and display the results in a loop, getting pieces of the file as they become available within a cffile loop... basically , read records and keep track of where you were at, then re-read and display more if it is available.

Do this in a loop. with a Pause in the loop, you can use this trick
http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_21686021.html
Maybe output more data every 10 seconds.

You can protect yourself from the program dying and not outputting all it's data by putting a counter in and only looping for X number of itterations (at 10 seconds each, or whatever, you can time it out to however long you want).

This would be dependent on knowing when the output is done from the program though via a special string or character... or, if you knew it output data pretty regularly, maybe you do a 5 second pause loop, and if there is no new data, you consider it done, or something similar...

As I said, it may not be worth it, but it could work reasonably well depending on your requirements and ability to modify what is in place.
0
ComputronAuthor Commented:
Thanks for the responses guys. I went about this a bit different as there just wasn't a clean way to accomplish this.
0
RCorfmanCommented:
I believe that the question was answered. The given answers provided methods to do this, or input on why it really isn't possible to do exactly what was originally requested.  It is my opinion that points should be allocated.
0
JeffHowdenCommented:
I agree with RCorfman, FWIW.
0
GranModCommented:
Closed, no 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.