Win98 tcl 8.3.4
I have a script which will launch a console exe file and capture the output into a text widget using the procedures below. This is fine if the application needs no input from the user via keyboard, but how do i get the application to wait for input if required, and get it? I do not want to have to pipe input in from a text file which contains all the input needed.
Any suggestions which don't require Expect as I'm not using NT please if possible.
Thanks in advance
Mark
proc Run {} {
global command input log but
if [catch {open "|$command"} input] {
$log insert end $input\n
} else {
fileevent $input readable Log
$log insert end $command\n
$but config -text Stop -command Stop
}
}
# Read and log output from the program
proc Log {} {
global input log
if [eof $input] {
Stop
} else {
gets $input line
$log insert end $line\n
$log see end
}
}
I have a script which will launch a console exe file and capture the output into a text widget using the procedures below. This is fine if the application needs no input from the user via keyboard, but how do i get the application to wait for input if required, and get it? I do not want to have to pipe input in from a text file which contains all the input needed.
Any suggestions which don't require Expect as I'm not using NT please if possible.
Thanks in advance
Mark
proc Run {} {
global command input log but
if [catch {open "|$command"} input] {
$log insert end $input\n
} else {
fileevent $input readable Log
$log insert end $command\n
$but config -text Stop -command Stop
}
}
# Read and log output from the program
proc Log {} {
global input log
if [eof $input] {
Stop
} else {
gets $input line
$log insert end $line\n
$log see end
}
}