[1/6] from: tmoeller:fastmail:fm at: 13-Jun-2006 12:54
Hi, i need to sum up some filesizes in my new script. As there are some really big files (10-100GB) i end up with negative values in my subtotal. So i investigated some more and found out that size? has a problem with these large values as it delivers the size in bytes. Has anyone a solution for this or can shed some light on me?? Thorsten -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again
[2/6] from: tmoeller:fastmail:fm at: 13-Jun-2006 13:31
Okay, i found some old thread on this topic on rebol.org, pointing out, that rebol internally uses 32bit integers for size. Thats where the limit came from. Has anything changed till then, as it was submitted to RAMBO some long time ago (end of 2004)? Thorsten On Tue, 13 Jun 2006 12:54:46 +0200, "Thorsten Moeller" <tmoeller-fastmail.fm> said:
> Hi, > i need to sum up some filesizes in my new script. As there are some
<<quoted lines omitted: 9>>> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- http://www.fastmail.fm - And now for something completely different=85
[3/6] from: rebolek::gmail::com at: 13-Jun-2006 15:07
AFAIK REBOL is still 32bit only (however, there's a module BigNum but it's used only internally), but REBOL3 should support 64bit integers. Rebolek On 6/13/06, Thorsten Moeller <tmoeller-fastmail.fm> wrote:
> Okay, > i found some old thread on this topic on rebol.org, pointing out, that
<<quoted lines omitted: 30>>> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- / Boleslav Brezovsky http://krutek.info \
[4/6] from: SunandaDH:aol at: 17-Jun-2006 9:12
> Has anyone a solution for this or can shed some light on me??
Not a solution -- but a possible work around. problem 1: counting beyond 2**32 Integer! doesn't work as you've noted. Decimal! values in REBOL are precise to around 10**14, so you can safely (as far as I can tell) do precise arithmetic up to around that bound: n: 0.0 for p 0 14 1 [ loop 9 [ n: 10 ** p + n ] ] n Problem 2: getting the file sizes info? won't work as it returns the value in an integer. So you need to use an operating system call of some sort. Under Windows with a version of REBOL that has CALL enabled, it's simple: my-dir: copy "" call/output "dir" my-dir You can then parse out the file size column from the captured directory listing. Sunanda.
[5/6] from: ale870:gmai:l at: 17-Jun-2006 15:50
If I remember you sayd that, with large file size, you get negative values (if I remember well). It happen since the variable, when reached the maximum value, continue from the lowest (megative) value. Since the maximum value should be 2^32 (try it), from the negativ value you should be able to extract the right offset to be added to get the correct file size. Of course, 2^-31 ---> 0 ----> 2^32 this method works only for negative values. --Alessandro On 6/17/06, SunandaDH-aol.com <SunandaDH-aol.com> wrote:
[6/6] from: tmoeller:fastmail:fm at: 19-Jun-2006 15:51
Hi Sunanda, thanks for your explanation. I was thinking of the call scenario before, but thought there was a better way. Normally info? or size? should do the job. But i learned that to wait for it to do so could be a little bit too time consuming. So i think using call is the best solution available. Cheers Thorsten On Sat, 17 Jun 2006 09:12:50 EDT, SunandaDH-aol.com said:
> Thorsten: > > Has anyone a solution for this or can shed some light on me??
<<quoted lines omitted: 24>>> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- http://www.fastmail.fm - The way an email service should be
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted