[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: FileTest.size > 2GB ?

Berger, Daniel

3/13/2006 8:45:00 PM



> -----Original Message-----
> From: Dave Burt [mailto:dave@burt.id.au]
> Sent: Monday, March 13, 2006 1:29 PM
> To: ruby-talk ML
> Subject: Re: FileTest.size > 2GB ?
>
>
> Nobu wrote:
> > mswin32 version doesn't have large file support yet.
>
> Daniel Berger wrote:
> > Yes, use win32-file, available on the RAA.
>
> Daniel, you are the hero of Ruby users on Windows.
>
> Dave.

Heh, thanks. :)

The long version of this is that win32-file uses GetFileSizeEx() behind
the scenes to get the file size instead of using the 'size' member of
the File::Stat structure. I suppose I should mention that it will only
work properly on Windows 2000 and later. Hopefully no one is still
using Windows NT any more. It could be fixed by using __int64 behind
the scenes iirc but I haven't looked at it in a while.

One of the things on the TODO list is to redefine the File::Stat
structure on Windows completely (and submit a patch) because there are
several other members that should be added (e.g. stuff you can get via
the GetFileAttributes() function) and a few current ones that need
fixing, e.g. 'chardev?'. I've been lazy about it, in part because of
the custom definitions of the Comparable methods such as '==', which is
a lot of annoying grunt work to implement. This might be easier,
however, now that I've more or less decided to ditch C extensions in
favor of pure Ruby Win32API packages for most (though not all) of the
win32utils packages.

In fact, win32-file is the package I plan on reworking into pure Ruby
form next. :)

Regards,

Dan