Cannot pass a binary stream as :INPUT to UIOP:RUN-PROGRAM
Hello,
I am on Debian "bullseye", SBCL 2.1.1.
If I call UIOP:RUN-PROGRAM like this
(with-open-file (s "foo.gz" :element-type '(unsigned-byte 8))
(run-program "cat >/home/spwhitton/tmp/blah" :force-shell t :input s))
then I get an error, however it works fine if I do this:
(run-program "cat >/home/spwhitton/tmp/blah" :force-shell t :input #P"foo.gz")
It seems to me like it ought to be possible to provide a binary stream if it possible to provide a binary file. I believe :ELEMENT-TYPE is irrelevant here as that is for output streams, but I did try setting it and it does not help.
Taking a look at the source, the cause of this seems to be that UIOP:RUN-PROGRAM calls UIOP:COPY-STREAM-TO-STREAM with no :ELEMENT-TYPE argument, so UIOP:COPY-STREAM-TO-STREAM tries to read characters from the provided binary stream.
Thanks!