Forum: Ruby Re: FileTest.size > 2GB ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-03-13 21:47
(Received via mailing list)
> 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
This topic is locked and can not be replied to.