Copy link to clipboard
Copied
I have batch file that runs on the server from cold fusion
. It kicks off a program that takes a variable amount of time to complete. When this program starts it creates a file called response.xml. As it runs, it updates this file. The last value it puts in is always the same. It is an indicator that it is done.
Is their some function I can use from cold fusion that would run the program on the server like it currently does, and then scan that file till that value appears. Once that value appears it kicks off another program on the server.
Currently I have cold fusion run the first batch file. Then I usually wait 5 minutes (which is one minute over the max time the program has ever taken to run). I then have cold fusion run a second program on the server. I would like to automate the entire process.
Any help would be appreciated.
Copy link to clipboard
Copied
Would <cfschedule> help you with this?
You can create a schedule at end of the first program, which pointed to the second program. So the second program automatically scheduled in to X min form the run time of the first program. Or you can have the second program running on your server every X number of minute, all around the day, checking if the file exists, if so scan it. You can make some sort of a mark on the file (rename the file or move it to some other folder or database entry or something), so it won’t re-scan in the next run.
Copy link to clipboard
Copied
You may want to investigate the Directory Watcher Gateway:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-77f7.html
Copy link to clipboard
Copied
Why do you not just have the initial batch file kick off the second once it's created the xml?
Copy link to clipboard
Copied
An alternative to using CFSCHEDULE or a directory watcher event gateway is to simply have your batch file call a CF page using wget or cURL.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
Read this before you post:
http://forums.adobe.com/thread/607238
Copy link to clipboard
Copied
Erm, not to be confused with exactly what I just said