On 2012-03-23, Nicolas Neuss <
last...@scipolis.de> wrote:
> (let* ((process (sb-ext:run-program
> "/bin/cat" '()
> :wait nil :input :stream :output :stream))
> (input (sb-ext:process-input process))
> (output (sb-ext:process-output process)))
> (write-line "Hello" input)
> (force-output input)
> (print (read-line output))
> (close input)
> (close output))
Thanks for the hint, Nicolas. That helped me to get closer to the
problem. Please see below.
> (Maybe the missing FORCE-OUTPUT or the missing :wait nil is your problem?)
No, the missing FORCE-OUTPUT don't seem to be the problem. In addition,
PROCESS-CLOSE shold call FORCE-OUTPUT before closing, IMHO.
The real problem seems to be a little bit more subtle. First thing is, I need
to add
:wait nil
to the lambda-list. (well reading the docs helps. Sorry, my fault )
Now comes the subtle thing: Once RUN-PROGRAM is called without
the :WAIT NIL parameter, further calls to RUN-PROGRAM will no longer close the
streams properly, regardless whether :WAIT NIL parameter is included in those
later calls or not. The same holds true if I ever call SB-EXT:PROCESS-WAIT to
collect zombies. I need to quit the sbcl instance and start another one to get
it working again.
Might this be a bug in sbcl-1.0.55? Or is it related to SLIME?