[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finishing output translating stream

From: Michael Sperber <sperber@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: finishing output translating stream
Date: Mon, 06 Jun 2005 17:15:57 +0200

> Presently, no.  I understand your motivation for wanting to know when
> it's closed (many thanks for the elaborate explanation!)---could you
> elaborate on why it's also important on flush?  (After all, the
> underlying stream may also flush at just about any time.)

Actually I'm not sure about flushing.  I thought of the case
such that I'm sending a string packet over a pipe or socket, and
want to make sure I send entire string, without worrying that the
last few characters might be sitting in the character conversion

But I might be able to achieve it by creating and closing a
stream each time I want a complete "packet".  Though it
seems to me lots of overhead, it may be doable.

> As for closing---do you have any suggestion on API?  I guess the
> easiest thing would be to also provide a "close" procedure along with
> the "translate" procedure.

Or passing special value (e.g. #f) as "bytes"?