# Large file support on Windows

**URL:** <https://www.ruby-forum.com/t/large-file-support-on-windows/154739>\
**Category:** Ruby\
**Created:** [December 3, 2008, 12:55pm UTC](https://www.ruby-forum.com/t/large-file-support-on-windows/154739 "2008-12-03T12:55:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![larsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@larsch](https://www.ruby-forum.com/u/larsch)\
**Post date:** [December 3, 2008, 12:55pm UTC](https://www.ruby-forum.com/t/large-file-support-on-windows/154739/1 "2008-12-03T12:55:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![larsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@larsch](https://www.ruby-forum.com/u/larsch)\
**Post date:** [December 3, 2008, 1:21pm UTC](https://www.ruby-forum.com/t/large-file-support-on-windows/154739/2 "2008-12-03T13:21:34Z")

</div>

Lars C. 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

---

<div class="post-metadata">

**Author:** ![larsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@larsch](https://www.ruby-forum.com/u/larsch)\
**Post date:** [December 3, 2008, 1:51pm UTC](https://www.ruby-forum.com/t/large-file-support-on-windows/154739/3 "2008-12-03T13:51:00Z")

</div>

On Dec 3, 1:15 pm, Siep K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Lars C. 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.

---

<div class="post-metadata">

**Author:** ![larsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@larsch](https://www.ruby-forum.com/u/larsch)\
**Post date:** [December 3, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/large-file-support-on-windows/154739/4 "2008-12-03T16:30:56Z")

</div>

On Dec 3, 4:54 am, Lars C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
