I have ...
set fid [open "|cprgm" "r+"]
fconfigure $fid -buffering line
.
.
.
puts $fid "1"
gets $fid c_return
Where cprgm is a C program that basically sits in an infinite loop, waits for input with the scanf cmd,
then takes the input and goes through a switch/case
cmd based on the value of the input.
The C program runs fine by itself (i.e. - standalone),
however when I run it with the above tcl code, it gives the following error:
Can't read "fid": no such variable.
When I look at the stack trace for error, it fails at the
puts line above.
Could it be it can't find the cprgm file (even though I've tried using the absolute path in the open cmd).
I'm stumped. Thanks for any help!!!!
set fid [open "|cprgm" "r+"]
fconfigure $fid -buffering line
.
.
.
puts $fid "1"
gets $fid c_return
Where cprgm is a C program that basically sits in an infinite loop, waits for input with the scanf cmd,
then takes the input and goes through a switch/case
cmd based on the value of the input.
The C program runs fine by itself (i.e. - standalone),
however when I run it with the above tcl code, it gives the following error:
Can't read "fid": no such variable.
When I look at the stack trace for error, it fails at the
puts line above.
Could it be it can't find the cprgm file (even though I've tried using the absolute path in the open cmd).
I'm stumped. Thanks for any help!!!!