Ticket #318 (closed defect: fixed)
RUN-PROGRAM I/O limitations
|Reported by:||gb||Owned by:||gb|
|Component:||Foreign Function Interface||Version:||unspecific|
(run-program ''prog'' args :output ''lisp-stream'' :error ''lisp-stream'')
doesn't work as expected. CCL::MONITOR-EXTERNAL-PROCESS only has the ability to watch output on a single file descriptor, and in this case it winds up watching the input side of a pipe used as the error descriptor by the external program, and output is lost.
(defun foo () (with-output-to-string (out) (with-output-to-string (err) (run-program "ls" '("-l") :output out :error err) (format t "~& out = ~a" (get-output-stream-string out)) (format t "~& err = ~a" (get-output-stream-string err)))) nil)
Calling (FOO) produces the output:
out = err =
which basically means "there was no error output, and we weren't watching standard output"
Even though this is apparently a litte obscure (I don't recall it ever having been reported), it's probably fair to call it 'major'.
Using :ERROR :OUTPUT provides a way of getting both standard and error output, but not a way of distinguishing between them.