Rebol 2 ports are a bit of a mess. Thus, you cannot directly apply a sample of how to read a large file in parts , because it readdoes not work on port!in R2 (it works much less read/part).
But if you jump over several hoops and use the refinement /directto open the file, you will get something that will work:
; Rebol 2 chunking http download sample
filename: %ubuntu-10.04-desktop-i386.iso
base-url: http:
chunk-size: 32000
in-port: open/binary/direct rejoin [base-url filename]
out-port: open/binary/direct filename
while [not none? data: copy/part in-port chunk-size] [
append out-port data
]
close in-port
close out-port
( UPDATE: READ-IO Sunanda, R2 READ-IO. http . : P)
Rebol 3 port!. , , ...
; Rebol 3 chunking http download sample
; Warning: does not work in A99 release
filename: %ubuntu-10.04-desktop-i386.iso
base-url: http://mirror.bytemark.co.uk/ubuntu-releases/lucid/
chunk-size: 32000
in-port: open/read rejoin [base-url filename]
out-port: open/write filename
while [not empty? data: read/part in-port chunk-size] [
write out-port data
]
close in-port
close out-port
, R3 alpha, /part read, HTTP.: (