controlling subprocesses

View: New views
3 Messages — Rating Filter:   Alert me  

controlling subprocesses

by Michael Grossbach :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The manual (ch. 37.5) suggests popen and popen2 for communication
between Octave and other processes. I tried to interface AutoIt
(v3.3.0.0, http://www.autoitscript.com/) - a Basic dialect - through
popen2 but somehow got stuck. I am quite sure that I make a mistake on
the Octave side but cannot find what I am doing wrong. Maybe someone on
the list can enlighten me. Here's what I do:
The Basic script octavetest.au3 takes a command line argument and shows
it in a message box. This works fine if I call it from the prompt in a
DOS box on Windows XP:
U:\>C:\Programme\AutoIt\AutoIt3.exe d:\comm\octavetest.au3 7
As expected, the message box shows a 7 (if I change the command line
argument the value shown changes accordingly).
If octavetest.au3 is called from Octave as in:
octave-3.0.3.exe:3>popen2('C:\Programme\AutoIt\AutoIt3.exe
d:\comm\octavetest.au3 7')
[the above on one line!] Octave responds with
error: popen2: process creation failed
Interestingly,
octave-3.0.3.exe:4>popen2('C:\Programme\AutoIt\AutoIt3.exe')
does start AutoIt but obviously without running the script octavetest.au3
I'd be grateful for any hints and pointers.

Thanks, Michael
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: controlling subprocesses

by martin_helm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Michael Grossbach wrote:
The manual (ch. 37.5) suggests popen and popen2 for communication
between Octave and other processes. I tried to interface AutoIt
(v3.3.0.0, http://www.autoitscript.com/) - a Basic dialect - through
popen2 but somehow got stuck. I am quite sure that I make a mistake on
the Octave side but cannot find what I am doing wrong. Maybe someone on
the list can enlighten me. Here's what I do:
The Basic script octavetest.au3 takes a command line argument and shows
it in a message box. This works fine if I call it from the prompt in a
DOS box on Windows XP:
U:\>C:\Programme\AutoIt\AutoIt3.exe d:\comm\octavetest.au3 7
As expected, the message box shows a 7 (if I change the command line
argument the value shown changes accordingly).
If octavetest.au3 is called from Octave as in:
octave-3.0.3.exe:3>popen2('C:\Programme\AutoIt\AutoIt3.exe
d:\comm\octavetest.au3 7')
[the above on one line!] Octave responds with
error: popen2: process creation failed
Interestingly,
octave-3.0.3.exe:4>popen2('C:\Programme\AutoIt\AutoIt3.exe')
does start AutoIt but obviously without running the script octavetest.au3
I'd be grateful for any hints and pointers.

Thanks, Michael
_______________________________________________
Help-octave mailing list
Help-octave@octave.org
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
I guess you should pass the command arguments as a separate argument to popen2

popen2('C:\Programme\AutoIt\AutoIt3.exe', { 'd:\comm\octavetest.au3', '7' } )

- mh

Re: controlling subprocesses

by Michael Grossbach :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

martin_helm wrote:
> I guess you should pass the command arguments as a separate argument to
> popen2
>
> popen2('C:\Programme\AutoIt\AutoIt3.exe', { 'd:\comm\octavetest.au3', '7' }
> )
>
> - mh
>
Great, thanks! That was too obvious ;)

Michael
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave