Expect spawns on 64-bit Windows
- From: LisaY <lisaais@xxxxxxxxx>
- Date: Tue, 30 Oct 2007 11:00:38 -0700
I am trying to use an Expect loop to monitor output from a 32-bit
application on a 64-bit system running Windows Server 2003/SP2. The
original code ran ok under a 32-bit system but the Expect -re clauses
aren't triggering under the 64-bit system. ActiveState has said they
don't have a native 64-bit Expect (even in their Enterprise edition of
Tcl/Tk), however Expect appears to be working properly in all other
aspects.
In the 32-bit configuration, I could issue 'eval exp_spawn myapp' and
everything works fine. Under 64 bits, this results in "The system
cannot find the file specified" errors; however I am able to work
around this using
eval exp_spawn -open [open "|\"C:/mypath/myapp.exe\"" w+]
or even
eval exp_spawn cmd.exe /C "\"C:/mypath/myapp.exe\""
Several instances of myapp may be spawned at the same time, with their
spawn_ids maintained in a list.
Pseudocode for my setup:
:
eval exp_spawn -open [open "|\"C:/mypath/myapp.exe\"" w+]
:
expect {
-i <list of spawn IDs>
-re <pattern1> {<response1>}
-re <pattern2> {<response2>}
:
eof {<eof response>}
}
'Myapp' is executing properly (all instances) and can be seen in Task
Manager. However it is generating text that should be matching/
triggering the defined Expect-loop patterns, yet no pattern triggers
(except eof). exp_internal indicates nothing but empty strings being
tested against. I've experimented with stdout/stderr redirection but
no success to date.
Any ideas on why Expect isn't seeing the I/O from myapp, and how I can
get this to work? Many thanks for any feedback.
.
- Follow-Ups:
- Re: Expect spawns on 64-bit Windows
- From: David Gravereaux
- Re: Expect spawns on 64-bit Windows
- Prev by Date: Re: Using expect with telnet menu
- Next by Date: Restart an application
- Previous by thread: Tcl/Tk 8.5b2 RELEASED
- Next by thread: Re: Expect spawns on 64-bit Windows
- Index(es):