perl -V:sizesize -V:sizetype

On my Win32 perl 5.24.0 x64, I get 8byte size_t. On my ancient CentOS 4.6 perl 5.8.5 (got you beat with how ancient a perl I'm stuck with is), I see 4byte size_t. If you convert your 4byte negative into a 4byte unsigned, or into a float using float(4byte signed integer) + 2**32, you'll get your 3.8GB size:

perl -e 'printf "%08x => %.0f => %.3e\n", $_, $_+2**32, $_+2**32 for -426648576'

I am thus betting you'll get -V:sizesize of 4 bytes, (edit:) but it will be a float rather than an int

edit2: improve parens in the paragraph. Also, to base the conversion on the sizesize, use Config; $Config{sizesize}==4 ? convert($filesize): $filesize...

edit3: clarify signed integer as the argument to float(); remove extra single-quote in edit2. Why didn't I see these before posting?


In reply to Re: Integer overflow in -s or file stat results by pryrt
in thread Integer overflow in -s or file stat results by Laurent_R

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.