MathGroup Archive 2003

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

Search the Archive

Re: Run[] and Mathlink


Hello James,
        It's not quite impossible.  Instead of something like

    Run["dir"]

you can also try

    ReadList["!dir",String]

or even

    Import["!dir","Lines"] .

and you will not get a console window appearing under Windows 2000.   Of
course it is not equivalent to Run[] because Mathematica has to wait for the
"console output"  to appear and the command to terminate.  However that
might be enough, depending on your needs, and it's easier than Mathlink.

[For accelerator people like us:
You may be interested in the runMAD function in my Madtomma`RunningMAD
package which uses this technique to run the MAD program.  It can be
downloaded (with other packages) from

http://jowett.home.cern.ch/jowett/Mathematica/math.zip

Under Windows 2000 and XP you can set the runMADNThack option to False
(default is still True, maybe I should change that ... ) and the console
windows will not appear.    See also the MADprogram option of runMAD.]

John Jowett

"John Smith" <j.s at bt.com> wrote in message news:bm0j27$po2$1 at smc.vnet.net...
>
> Hi,
> I would like to be able to run operating system commands on win2000
without
> the dos box popping up all the time. A quick scan through the archives
have
> shown that this is impossible with the current Mathematica implementation.
> However, the idea of using Mathlink to pass options to CreateProcess() in
> windows as opposed to system() has been suggested as a solution
> http://forums.wolfram.com/mathgroup/archive/2000/Oct/msg00082.html.
> Since my knowledge of programming outside mathematica is limited, has a
> member of the group ever programmed this?
> If not, a brief suggestion as to how to at least start programming such a
> function, preferably in C, would be grateful.
>
> Many thanks,
>
> James Jones
> ========================================
> Accelerator Physicist
> Accelerator Physics Group
> ASTeC
> Daresbury Laboratory
> Warrington,
> Cheshire
> WA4 4AD
> UK
>
>
>
> .
>



  • Prev by Date: Re: Help with Nonlinear Fitting?
  • Next by Date: RE: Fields or forms on manifolds
  • Previous by thread: Run[] and Mathlink
  • Next by thread: Re: Run[] and Mathlink