From: Greg Hauptmann Date: 2006-12-04T06:20:05+09:00 Subject: Re: File.size() returning negative for large files ???? ------=_Part_15398_24234939.1165180794032 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline where do you get win32-file? I don't see it in the api or on the wiki? Is it a gem I have to load? Tks On 12/4/06, Daniel Berger wrote: > > Pedro Fortuny Ayuso wrote: > > On 12/3/06, Eric Hodel wrote: > >> > >> On Dec 3, 2006, at 24:30 , Greg Hauptmann wrote: > >> > On 12/3/06, Damjan Rems wrote: > >> >> Greg Hauptmann wrote: > >> >>> I'm getting a negative number being returned for large files when > >> >>> using File.size()??? Any ideas? One of my ruby books says an > >> >>> Integer can be any size?? > >> >>> > >> >>> I'm using: > >> >>> - File.size(path) > >> >>> - getting negative number responses for large files (e.g. > >> >>> -1001581 where file was really around 3.2GB) > >> >> > >> >> It is not yours, but Windows fault. > >> > > >> > Is there a work around for this guys? > >> > >> [-1001581].pack('l').unpack('L').first # => 4293965715 > > > > > > However, notice that for VERY large files, (larger than 4Gb, I guess, > > or 4294967296 bytes), that method fails also > > > > [4294967296].pack('l') > > > > is the same as > > > > [4294967296*2].pack('l') > > > > So something different ought to be used. You might as well get > > the info from "system (dir)" or similar for your specific case. > > > > Pedro > > > > > > > > Try 'Q' instead. Or, just use win32-file. :) > > Regards, > > Dan > > ------=_Part_15398_24234939.1165180794032--