R
Roeland Moors
I'm trying to communicate with a program (gnucap) using ruby.
The versions of ruby (1.8.1) and gnucap (0.34) are the same on windows
and linux.
When I start gnucap, this is the output:
Gnucap 0.34
The Gnu Circuit Analysis Package
Never trust any version less than 1.0
Copyright 1982-2002, Albert Davis
Gnucap comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome
to redistribute it under certain conditions
according to the GNU General Public License.
See the file "COPYING" for details.
gnucap> _
Here is a simple ruby test program:
<-- CODE -->
#!/usr/bin/env ruby -w
gnucap = IO.popen("gnucap", "w+")
output = ""
while output !~ /.*#{"gnucap>"}$/
char = gnucap.getc.chr
output += char
end
puts "ok"
<-- CODE -->
In Linux this program works and shows me "ok". But on windows the
program stops reading after the last newline: "...details."
This means the program never reach ok.
It keeps waiting for input.
Any ideas or suggestions?
Thanks
The versions of ruby (1.8.1) and gnucap (0.34) are the same on windows
and linux.
When I start gnucap, this is the output:
Gnucap 0.34
The Gnu Circuit Analysis Package
Never trust any version less than 1.0
Copyright 1982-2002, Albert Davis
Gnucap comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome
to redistribute it under certain conditions
according to the GNU General Public License.
See the file "COPYING" for details.
gnucap> _
Here is a simple ruby test program:
<-- CODE -->
#!/usr/bin/env ruby -w
gnucap = IO.popen("gnucap", "w+")
output = ""
while output !~ /.*#{"gnucap>"}$/
char = gnucap.getc.chr
output += char
end
puts "ok"
<-- CODE -->
In Linux this program works and shows me "ok". But on windows the
program stops reading after the last newline: "...details."
This means the program never reach ok.
It keeps waiting for input.
Any ideas or suggestions?
Thanks