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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 30 Jun 2005 at 00:16, Richard Lynch wrote:

> 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.

yes. especially since each of our front-end webservers would need to be
64-bit to do what i was hoping to do. what I was hoping for was a way to
make php use 64-bit integers (or fake it somehow), such as apache2.0.54
does for files of that size.

> > 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.

well, it may suffice actually. I'm just not sure of the performance impact
of doing this for every file from all our front-end boxes anytime someone
does a directory listing.

thanks for the answers :-)

--dan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux