Large file support on Windows

Discussion in 'Ruby' started by Lars Christensen, Dec 3, 2008.

  1. 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.
     
    Lars Christensen, Dec 3, 2008
    #1
    1. Advertising

  2. 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
    --
    Posted via http://www.ruby-forum.com/.
     
    Siep Korteling, Dec 3, 2008
    #2
    1. Advertising

  3. On Dec 3, 1:15 pm, Siep Korteling <> 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.
     
    Lars Christensen, Dec 3, 2008
    #3
  4. On Dec 3, 4:54 am, 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.


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

    Regards,

    Dan
     
    Daniel Berger, Dec 3, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mathew
    Replies:
    0
    Views:
    281
    Mathew
    Nov 25, 2003
  2. Tim Peters
    Replies:
    2
    Views:
    316
    Mathew
    Nov 25, 2003
  3. prachi
    Replies:
    0
    Views:
    660
    prachi
    Jan 17, 2009
  4. Aahz
    Replies:
    1
    Views:
    419
    Mark Hammond
    Apr 22, 2009
  5. Replies:
    5
    Views:
    994
    Xho Jingleheimerschmidt
    Apr 2, 2009
Loading...

Share This Page