in reply to How do I get correct file size for huge file under Win32?

As far as I know, perl store file size value in a 32bit integer that means it's not possible to get the correct value if file size larger than 3.9G. But you can try Win32::DirSize


I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

  • Comment on Re: How do I get correct file size for huge file under Win32?

Replies are listed 'Best First'.
Re^2: How do I get correct file size for huge file under Win32?
by BrowserUk (Patriarch) on Nov 25, 2008 at 13:08 UTC

    As long as the perl in question is built with uselargefiles=define, (which means all AS perls and most others by default for at least the last 6+ years, probably longer), then perl quite happily, accurately and correctly deals with files up to at least 9e15 (~9,000 Terabytes).

    Also, I don't think it's even possible to get Win32::DirSize to give the size of a single file--unless it happened to be the only file in the directory--but in any case, it (and all it's conversion functions/methods) are totally unneccessary unless you have access to a filesystem that can store a single file > 9e15. (Is that even possible given current disk technology?)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.