Opened 13 years ago

Closed 12 years ago

#318 closed defect (fixed)

RUN-PROGRAM I/O limitations

Reported by: gb Owned by: gb
Priority: major Milestone:
Component: Foreign Function Interface Version: unspecific
Keywords: Cc:


 (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))))

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.

Change History (4)

comment:1 Changed 13 years ago by rs

using :stream as the argument for output and error works like expected. (it's just somewhat inconvenient to read out the streams...)

comment:2 in reply to: ↑ description Changed 12 years ago by danieldickison

Another related issue (from openmcl-devel): when you specify different streams for :error and :output, one of the pipe's file descriptor remains open indefinitely.

comment:3 Changed 12 years ago by rme

  • Milestone 1.2 deleted

Milestone 1.2 deleted

comment:4 Changed 12 years ago by gb

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.