From: Neil T. Dantam <ntd@ga...> - 2009-08-26 04:02:19
I have a question regarding the :output :stream option to
sb-ext:run-program and doing binary IO with the child process. I have
code that does roughly the following:
(let ((process sb-ext:run-program "foo" (list "arg")
:search t :wait nil
(buffer (make-array 12 :element-type 'unsigned-byte)))
(read-sequence buffer (sb-ext:process-output process))
(values buffer process))
Rather than getting an array of unsigned bytes, I seem to be getting
an array of characters (or an error if the particular byte sequence
isn't a valid UTF-8 character). Calling stream-element-type of the
stream gives 'character and calling stream-external-format gives
:UTF-8. I can call read-byte multiple times, and it does return the
next byte in the stream, but I'd rather not bit-bang here.
Is there currently a way to get a binary stream that's connected to
the stdin/stdout of the child process? Am I missing something that
should be obvious here?
Get latest updates about Open Source Projects, Conferences and News.