[REBOL] Re: Does request-download download all file into memory?
From: rotenca:telvia:it at: 6-Feb-2002 14:55
> I just tried to download one large file from our intranet and was
> wondering, that "Not enough memory" message appeared in Rebol in
> Could anyone look at request-download ---> read-thru ----> read-net
> functions, as it seems to me that read-net function reads only part of
> the port, but it appends it to buffer, which is just rebol word, not
> opened file ...
> If so, then I don't understand why it is so, because if read-net/to is
> specified, we alredy know name of the file we can spool partialy
> downloaded data into. I sometimes miss such anync + memory safe behavior
> of default rebol functions. I know I can code it myself, but ....
> simplicity in default distro is always welcomed ;-)
Fro what i understand, read-net create a buffer of the exact lenght of http
if it can found it in the headers object, else use a 8000 byte buffer:
size: to-integer any [port/locals/headers/content-length 8000]
buffer: make binary! size