• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Scan text file until value appears then do action

New Here ,
Nov 30, 2010 Nov 30, 2010

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.

TOPICS
Advanced techniques

Views

692

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2010 Nov 30, 2010

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2010 Nov 30, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 01, 2010 Dec 01, 2010

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2010 Dec 01, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 01, 2010 Dec 01, 2010

Copy link to clipboard

Copied

LATEST

Erm, not to be confused with exactly what I just said

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation