I'm trying to use ftp as a co-process
(setf fconn (run-program "/usr/bin/ftp" '("-n" "192.168.0.1") :input
:stream :output :stream :error t :wait nil))
(write-line "user me pass" (process-input fconn))
(force-output (process-input fconn))
(write-line "ls" (process-input fconn))
(force-output (process-input fconn))
(read-line (process-output fconn))
(process-close fconn)
but it blocks at read-line.
If I change :output :stream to :output t, I see the results on my
terminal.
I tried
(setf ls (extensions:run-program "/bin/ls" '("/tmp") :input nil :output
:stream :error :stream :wait nil))
(read-line (process-output ls))
and it works.
Would it help to set the streams to unbuffered?
Can I do that in lisp?
Thanks
Richard