MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: External software

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119244] Re: External software
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Wed, 25 May 2011 19:34:56 -0400 (EDT)

Hi,

Run[..] is the right command and somthing similar works perfectly fine
on my Linux machine. Have you tried to give your command as

Run["program.exe", "-i oldfile.dat", "-o newfile.dat"]

Are you sure that your program.exe is found? Remember that when using
the commandline from within Mathematica your Paths and Environment
Variables may be different.

Have you checked your return code from Run? Try something simple like

Run["dir"]

and you should get 0 as return value (if this is on Windows the same
return code). When you run a command which does not exist, you should
get a different return code:

In[3]:= Run["forbar"]

Out[3]= 32512

Hope this helps a bit.

Cheers
Patrick

On Wed, 2011-05-25 at 05:54 -0400, ZnFinger wrote:
> Suppose I had an external program that took a file in and modified it,
> saving the modified version as a new file in this format
> 
> program.exe -i oldfile.dat -o newfile.dat
> 
> Is there any way to send this little command to the system command
> prompt? There is no need for information sharing between this program
> and mathematica, so it seems unnecessary to use Run, RunThrough or
> writing a MathLink. Using Run I can provoke a command prompt to pop up
> but the program is never run. Any suggestions?
> 




  • Prev by Date: Re: Precedence question
  • Next by Date: Re: NDSolve issues with initial and boundary conditions (corrected characters)
  • Previous by thread: External software
  • Next by thread: Position