[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: time events?

In article <37bcb731@mindmeld.idcomm.com>,
	"John D. Sample" <sample@idcomm.com> writes:
> I'm using IDL widgets to launch other applications on a unix network of 
> boxes using the SPAWN command.
> It would be nice to generate events automatically at certain times of the
> day.  Alternatively, if the contents of a pipe could generate an event, that
> would work too.  What I don't want to do is hard code a loop that
> continually reads a file or pipe, or checks the system time, and prevents
> the user from using other functions.
> Specifically, I need a way to determine whether a SPAWNed job is done so I
> can have IDL launch another one automatically.
> Thanks.  Chip

haven't tried. But there is a TIMER keyword to widget_control. One way to
check if your spawned command is through would be to SPAWN a ps | grep
command. As soon as you return an empty string your job is over. In a 
more sophisticated version of this you could try to get hold of the process
ID when you start the job (e.g. something like echo $$ > tmpfile ) and
then do   ps | grep `cat tmpfile` Then you could even spawn the same thing
several times simultanously.


[[     Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 441787                     [[
[[     martin.schultz@dkrz.de                                    [[