[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Checking status of external process
From: |
Quentin Spencer |
Subject: |
Checking status of external process |
Date: |
Wed, 15 Dec 2004 11:36:00 -0600 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041127) |
I want to run a command using the "system" function that starts an
external program that performs some computations. I would like to be
able to start it in the background, and then run a loop that periocially
checks the status of the program, loads the results, and kills the
external process if certain conditions are met, using a loop something
like this:
PID = system(command, 1, 'async');
while(1)
sleep(5)
if( PID has completed)
break
else
load results
perform computations
if(some condition)
kill(PID);
break;
end
end
end
The problem is that I don't know how to test to see whether PID has
completed running. Is there any way to do this using built in octave
commands? If not, how might I do this using system commands on a Linux
system?
-Quentin
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Checking status of external process,
Quentin Spencer <=