64 bit ports

Carl Sassenrath, CTO
REBOL Technologies
16-Mar-2007 17:02 GMT

Article #0068
Main page || Index || Prior Article [0067] || Next Article [0069] || 5 Comments || Send feedback

The potential size of files has changed since REBOL 2.0 was released. It was once highly unlikely that you'd refer to a file larger than 2GB. These days, it's become a regular thing for many users.

The new port design of REBOL 3.0 is now 64 bit. Both the size of the file and the index into the file are 64 bit.

So, this code will work for "any size" files:

f: open/binary %from-file
t: open/binary/new %to-file
while [data: take f 100000] [append t data]
close f
close t

A few notes:

  1. What's that take function? For now, just think of it as a copy with a remove. Unlike copy, take eats the input. This works for all series, not just ports. (I need to discuss take in a separate article.)
  2. There is a subtle but important change shown here. Do you see it? In R3, a port index is no longer part of the reference, it is part of the port value. But, that's also the subject of another article.


Updated 14-Jun-2024 - Edit - Copyright REBOL Technologies -