Re: Achieving 64-bit integers on 32-bit platforms

From: Date: Thu, 30 Jun 2005 07:16:34 +0000
Subject: Re: Achieving 64-bit integers on 32-bit platforms
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-217868@lists.php.net to get a copy of this message
On Wed, June 29, 2005 9:02 pm, Dan Goodes said: > This 32-bit limitation is haunting me everywhere I turn. > > Is it possible with PHP (at compile-time if need be) to make it use large > (64-bit) integers? I believe that PHP runs fine on 64-bit hardware, and uses 64-bit ints everywhere on that... So, in theory at least, just buying a 64-bit machine would "solve" your problem... Not that you necessarily *can* run out and buy a 64-bit machine, mind you. > I'm asking because I would like to perform operations on large files, and > > fillesize($filename) > > is returning an error, even when I use > > sprintf("%u", filesize($file)) > > as per the manual for filesize(). I get: > > Warning: filesize(): Stat failed for FC4-i386-DVD.iso (errno=75 - Value > too large for defined data type) > > Any thoughts/ideas/suggestions? Thanks! At least for THIS particular function, you could use exec("du $filename", ...) and then you'd have a string representation of the size, which you could then display or even manipulate with BC_MATH or that other new-fangled arbitrary precision mathematics PHP Module whose name I forget. This is a much less general solution, but may suffice for now. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#217868) next »