See SetFilePointer() in Win32API::File (which comes standard with Win32 Perl).

Note that using Perl file handles with this may present a problem. You might be able to simply seek before each call to SetFilePointer():

use Win32API::File qw( SetFilePointer GetOsFHandle ); sub BigTell { my( $fh )= @_; seek( $fh, 0, 1 ); # Flush buffers my $osf= GetOsFHandle( $fh ); my $hi= 0; my $lo= SetFilePointer( $osf, 0, $hi, 1 ); return pack "NN", $hi, $lo; } sub BigSeek { my( $fh, $pos, $whence )= @_; my $osf= GetOsFHandle( $fh ); seek($fh,0,1); # Flush buffers my( $posHi, $posLo )= unpack "NN", $pos; $posLo= SetFilePointer( $osf, $posLo, $posHi, $whence ) or return; return pack "NN", $posHi, $posLo; }
Note that I chose a format for the "big pointer" such that string comparisons are meaningful.

Unfortunately I don't have time at the moment to test this. However, if you have problems with it, reply and I'll likely be able to help.

On the other hand, please reply if this turns out to work well as it'd make a good addition to Win32API::File. (:

Updated to fix a typo.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: 4Gb filesize limit by tye
in thread 4Gb filesize limit by ruffing

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.