Re: Strange behaviour of *standard-output* in sbcl
- From: pjb@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
- Date: Wed, 30 Jul 2008 15:20:43 +0200
Haiwei <highfly22@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.
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.
--
__Pascal Bourguignon__
.
- Follow-Ups:
- Re: Strange behaviour of *standard-output* in sbcl
- From: Thomas A. Russ
- Re: Strange behaviour of *standard-output* in sbcl
- From: Haiwei
- Re: Strange behaviour of *standard-output* in sbcl
- References:
- Strange behaviour of *standard-output* in sbcl
- From: Haiwei
- Strange behaviour of *standard-output* in sbcl
- Prev by Date: Strange behaviour of *standard-output* in sbcl
- Next by Date: Lisp based DSL for bio on Ars Technica
- Previous by thread: Strange behaviour of *standard-output* in sbcl
- Next by thread: Re: Strange behaviour of *standard-output* in sbcl
- Index(es):