Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Calling External Program

by Anonymous Monk
on Jun 04, 2009 at 12:48 UTC ( #768419=note: print w/replies, xml ) Need Help??

in reply to Re: Calling External Program
in thread Calling External Program

Sorry about that. I'm running on Windows XP.

As for the system call, I can give you the dos command equivalent, which is
matlab -sd Directory -nosplash -r File1;File2
where Directory is the directory containing the files to run, -nosplash makes it run in background mode (I first tested it in GUI mode to make sure everything worked), and -r Files contains the files to be run. Perl behaves the same regardless of whether or not MATLAB is in background mode. I will try your suggestion to check for the PID periodically.

Replies are listed 'Best First'.
Re^3: Calling External Program
by ramlight (Friar) on Jun 04, 2009 at 18:18 UTC
    I have done something similar - though not exactly the same - with Win32::Process::Create. That gives you a $ProcessObj->Wait($timeout) method. However, from your description, I suspect that this will return immediately.

    If Wait() does return immediately, you should be able to find an entry in the tasklist for what is running and check that periodically for the programs completion. Without being more familiar with MATLAB, I can't be any more specific.

      Thanks for the feedback, but I found a simpler solution. After convincing my colleagues that the order the programs are called in doesn't really matter, simply calling MATLAB last solves the problem.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://768419]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-12-05 00:50 GMT
Find Nodes?
    Voting Booth?

    No recent polls found