From: Vladimir Zolotykh
Subject: _IOLBF on file stream
Date: 
Message-ID: <20060303153903.76a2b203.gsmith@eurocom.od.ua>
When I write

(print "Hello!")

I get "Hello!" printed immediately.
However if I do
(with-open-file (*standard-output* "/tmp/foo" :direction :output
                                              :if-exists :append 
                                              :if-does-not-exist :create) 
  (print "Hello!")
  (read))

I don't see nothing in /tmp/foo until I type something and READ
returns.  I could add (FORCE-OUTPUT) after PRINT. However the question
is: is it possible to get the same for the file stream as for
*terminal-io*? e.g. no buffering?

I mean something like
setvbuf( stream, (char *)NULL, _IOLBF, 0);
? 

-- 
Vladimir Zolotykh

From: Lars Rune Nøstdal
Subject: Re: _IOLBF on file stream
Date: 
Message-ID: <1141410764.432282.19990@t39g2000cwt.googlegroups.com>
Create a new package (`my-cl') and define your own version of `print'
there that calls `force-output' after the `cl:print' call.

-- 
mvh,
Lars Rune Nøstdal
http://lars.nostdal.org/
From: Pascal Bourguignon
Subject: Re: _IOLBF on file stream
Date: 
Message-ID: <87u0afh7m8.fsf@thalassa.informatimago.com>
Vladimir Zolotykh <······@eurocom.od.ua> writes:

> When I write
>
> (print "Hello!")
>
> I get "Hello!" printed immediately.
> However if I do
> (with-open-file (*standard-output* "/tmp/foo" :direction :output
>                                               :if-exists :append 
>                                               :if-does-not-exist :create) 
>   (print "Hello!")
>   (read))
>
> I don't see nothing in /tmp/foo until I type something and READ
> returns.  I could add (FORCE-OUTPUT) after PRINT. However the question
> is: is it possible to get the same for the file stream as for
> *terminal-io*? e.g. no buffering?
>
> I mean something like
> setvbuf( stream, (char *)NULL, _IOLBF, 0);
> ? 

Not portably.  Check the documentation of  the implementation you use,
it may have an implementation specific way to do it.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.