I'm porting a Ruby application to Racket (will be deployed on Linux, but I'm developing on OSX). It uses the s3270 terminal emulator to access a mainframe. An example in Ruby is:
pipe.puts "ascii"
puts (pipe.gets)
puts (pipe.gets)
end
That issues the "ascii" command, and then reads & displays 2 lines of output. It seems that Racket's subprocess is a reasonable choice for this, so I tried the following:
(define-values (subp inp outp errp)
(displayln "ascii" outp)
(displayln (read-line inp))
(displayln (read-line inp))
It seems to be connecting to the mainframe because I got a request from Little Snitch to allow the outbound connection. The s3270 emulator behaves similar to telnet, if I invoke the command in a shell, the program will start, then I'll enter ascii and it will display a screenful of lines. I must be misunderstanding subprocess or the associated IO functions. Any suggestions?
Thanks,
Brian