Forum: Ruby Large file support on Windows

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.
76caedd87445c17860358841ae0de620?d=identicon&s=25 Lars Christensen (Guest)
on 2008-12-03 12:55
(Received via mailing list)
Is there any way to get large file support on windows (>2^31 bytes)? I
need File.size, IO#seek and IO#tell to work with large files on
Windows.
D7908f05c89e965f6bc5308ad6f41256?d=identicon&s=25 Siep Korteling (steenslag)
on 2008-12-03 13:21
Lars Christensen wrote:
> Is there any way to get large file support on windows (>2^31 bytes)? I
> need File.size, IO#seek and IO#tell to work with large files on
> Windows.

If the filesystem is FAT32 then 4GB is the upper limit, no matter what
OS. ntfs has no limitation on filesize (other then the available
diskspace). Converting FAT32 to ntfs is simple, but there is no easy way
back.

hth,

Siep
76caedd87445c17860358841ae0de620?d=identicon&s=25 Lars Christensen (Guest)
on 2008-12-03 13:51
(Received via mailing list)
On Dec 3, 1:15 pm, Siep Korteling <s.kortel...@gmail.com> wrote:
> Lars Christensen wrote:
> > Is there any way to get large file support on windows (>2^31 bytes)? I
> > need File.size, IO#seek and IO#tell to work with large files on
> > Windows.
>
> If the filesystem is FAT32 then 4GB is the upper limit, no matter what
> OS. ntfs has no limitation on filesize (other then the available
> diskspace). Converting FAT32 to ntfs is simple, but there is no easy way
> back.

Thanks for your reply, but its been 5+ years since i have used
FAT32 ;-). Even on NTFS, I can't access large files using the
mentioned functions.

The issue here is that Ruby relies directly on the ofs_t typedef which
is always 32 bit on Microsoft's C runtime. 64-bit file-size support
requires a workaround (using for example fseeki64), but it is not that
straight forward due to the way the IO interface is made in Ruby (it
reliese on ofs_t everywhere).

I was just wondering if anyone had made an effort to make support for
large files in Ruby on Windows or any platform without the convinience
of a 64-bit ofs_t.
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (djberg96)
on 2008-12-03 16:30
(Received via mailing list)
On Dec 3, 4:54 am, Lars Christensen <lar...@belunktum.dk> wrote:
> Is there any way to get large file support on windows (>2^31 bytes)? I
> need File.size, IO#seek and IO#tell to work with large files on
> Windows.

File.size will work as expected if you first "require 'win32/file'" in
your code.

Regards,

Dan
This topic is locked and can not be replied to.