laziness, impatience, and hubris | |
PerlMonks |
Re: Integer overflow in -s or file stat resultsby BrowserUk (Patriarch) |
on Mar 07, 2017 at 17:00 UTC ( [id://1183850]=note: print w/replies, xml ) | Need Help?? |
It'll probably suffer the same flaw, but you could try POSIX::lseek with SEEK_END and an offset of 0. If successful it returns the byte offset of the position it reached. If it was really important to avoid system, you could step through the file using seek() with SEEK_CUR and a relative offset of 2**31 (remembering how many steps) and reading a byte until the read fails; then step back to the last good position and do a binary chop until you find the last position at which you can read a byte. All in all, system is almost certainly preferable. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|