Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I am writing a script that takes a data file and runs an application (spider.exe) to update a database. The problem I’m having is that I don’t know how to kill the application if it runs over a certain amount of time. I am able to start the application using the system command, and I can tell if the application finished processing because it generates an error file. I have also tried using proc::simple, but am having some interesting results. When starting the process, it always returns that the application has not started, yet it did start, and the poll function always returns the application is running even when it is not, and the kill method does not work at all. The server is running W2K, so the alarm function (as I understand from reading other threads) will not work either. I have also looked into IPC::Run, but am not sure if it will work (I could be wrong though) Does anyone have any suggestions on how to kill the application if it runs too long? Thanks

Things I’ve tried:
 system ("start k:\\spider\\spider.exe”); # works - don’t know how to kill application
$spiderProc = Proc::Simple->new(); $spiderStatus = $spiderProc->start("k:\\spider\\spider.exe"); print ("spider start status: $ spiderStatus"); # returns start failed $spiderPoll = $spiderProc->poll(); print ("test poll: $spiderPoll"); # returns running $tempExitStat = $spiderProc->kill(); print ("killing: $tempExitStat"); # returns fill failed

In reply to How to kill an external program by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-24 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found