[REBOL] Re: [BUG?] read-io & write-io or Wait or is TCL better?
From: dockimbel:free at: 24-Dec-2003 22:30
Selon Petr Krenzelok <[petr--krenzelok--trz--cz]>:
[...]
> I know I struggled really badly with exactly the same problem in the
> past. Although it may be reasonalble explainable that Rebol simply
> enlarges buffer, I think that we should think of submitting a bug
> request. And why? Because docs don't state that in the case of read-io
> we should clear the buffer. If it would lead only to buffer size
> increase, then OK, but it leads into completly broken communication with
> unexpected results ...
>
> What do other think? Should write-io clear the buffer after succesfull
> write automatically?
Read-io and write-io are low-level natives that behave more like their C
counterparts than like normal REBOL natives (no auto-expansion). I guess that
RT needed them to be able to accurately control low-level ports stuff, but
since 'set/get-mode natives appeared, low-level I/O natives shouldn't be used
anymore, as stated by Holger here (a year ago ?). I found them still usefull in
a few cases to optimize memory usage.
So, to answer your question, I think that low-level natives should remain low-
level. If you need automatic buffer expansion, you should use 'copy/insert
instead, with appropriate 'set-mode calls if necessary.
-DocKimbel