Hello:
When Holger speaks, I pay attention. I have the following line
of code for reading POST input from CGI as follows:
;=======================================
either tmp > 0
[
    buffer: make string! (tmp + 10) ; allocate storage space
    while [tmp > 0]                 ; and read
        ; I think Holger suggests this is not good:
        [tmp: tmp - read-io system/ports/input buffer tmp]
    return buffer
]
What would be a safe alternative, please?
TIA
-Tim
[EMAIL PROTECTED] wrote:

> Please avoid using read-io whenever possible. It is a very low-level
> function that exposes your script to operating system-dependent
> oddities. For instance the amount of data typically returned may vary
> with the operating system, making testing more difficult for you. You
> also lose the convenience of line feed conversion etc., which may cause
> unexpected problems with your script when moving between Windows and
> Unix machines. "Normal" port functions in REBOL (copy, insert etc.)
> do these things automatically for you.
>
> We realize that in the past some shortcomings in the "normal" port
> functions (in particular copy blocking) have prevented you from doing
> some useful things, and sometimes read-io seemed to help, but these
> issues should be resolved in the next exp builds, and then the use of
> read-io will be discouraged even more than it is now.
>
> And just in case you are wondering, those new port features together with
> work on some additional enhancements in VID are the reasons why the
> new exp build for View we promised earlier is not out yet -- sorry for
> that delay. RSN, really...
>
> --
> Holger Kruse
> [EMAIL PROTECTED]

Reply via email to