From: Juan Jose Garcia Ripoll <lisp@ar...> - 2005-05-02 18:03:31
- By default, the size of binary streams is rounded to a multiple of 8.
want other behavior, pass :USE-HEADER-P T to the function OPEN.
The previous behavior seems to be counterintuitive for people who expect
being able to write scripts as
(with-open-file (stdin "/dev/stdin" :element-type '(unsigned-byte 8)
:direction :input :use-header-p nil)
(with-open-file (stdout "/dev/stdout" :element-type '(unsigned-byte 8)
:direction :output :use-header-p nil)
(loop with buffer = (make-array 4096 :element-type '(unsigned-byte 8))
for length = (read-sequence buffer stdin)
while (plusp length)
do (write-sequence buffer stdout :end length