Large file support on Windows

  • Thread starter Lars Christensen
  • Start date
L

Lars Christensen

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.
 
S

Siep Korteling

Lars said:
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
 
L

Lars Christensen

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.
 
D

Daniel Berger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top