Re: Strange behaviour of *standard-output* in sbcl



On Jul 30, 9:20 pm, p...@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
wrote:
Haiwei <highfl...@xxxxxxxxx> writes:
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))

You don't close the file, so some bytes remain in the buffer.

Thanks. I got all the output after closed the stream.


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.

No, just be sure to close the file.  WITH-OPEN-STREAM makes sure
stream is closed, which is why JUDYDL-ENUMERATE-FILE works.
By the way, isn't there anything choking you?

        WITH-OPEN-STREAM
 JUDYDL-ENUMERATE-FILE

Use rather WITH-OPEN-FILE, in JUDYDL-ENUMERATE-FILE.  
Or implement a JUDYDL-ENUMERATE-STREAM.

In general, you will use WITH-OPEN-FILE.  

Yes. I will. But when to use WITH-OPEN-STREAM?


--
__Pascal Bourguignon__

.