Reply to Re: [PHP] Achieving 64-bit integers on 32-bit platforms

Your name:

Reply:


Posted by "Richard Lynch" on 06/30/05 10:16

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация