Strange behaviour of *standard-output* in sbcl



Hi,

When executing following expression, the output file only has part of
contents. The size of this file is 12281.

(let ((*standard-output* (open "/home/haiwei/tmp/tmplog"
:if-exists :rename-and-delete
:if-does-not-exist :create
:direction :output)))
(judydl-enumerate root je))

But I wrote another function which open a file and write data into
it. Then I got all the contents.
Is there any buffer or size limit on *standard-output* in sbcl?
My OS is ubuntu 8.04. The version of sbcl is 1.0.11.debian.

(defun judydl-enumerate-file (root je file)
(with-open-stream (stream (open file :if-exists :rename-and-
delete :if-does-not-exist :create :direction :output))
(let ((len 0)
(value 0)
(index (make-string 100))
(outlen (make-alien (unsigned))))
(setf (deref outlen) 100)
(loop for p = (JudyDLFirst (deref root)
(sap-alien (sb-sys:vector-sap index)
(* char))
len
outlen
je)
then (JudyDLNext (deref root)
(sap-alien (sb-sys:vector-sap index)
(* char))
len
outlen
je)
while (not (eq (sb-sys:sap-int (alien-sap p)) 0)) ;fixme
do (progn
(setf len (deref outlen))
(setf value (deref (cast p (* (unsigned)))))
(when (> value 10)
(format stream "~A ~A~%" (subseq index 0 (/ len 4))
value)))))))

Thanks,
Haiwei
.