Get information of large files on 32 bit systems using PHP

Over the last few years following the development of Ajax File Browser (now known as Limpid Browser), various users have had troubles with getting the application to report the correct size of large files (greater than 2gib) on 32bit systems.

With recent development on Limpid Browser I didn’t want to carry over this problem. So I’ve been dedicated to getting this flaw sorted, since the PHP team doesn’t want to.

So here it is. This class will help you return an accurate size and file modified time for all types of files on Linux, BSD and Windows. You can also use this class on 64 bit systems and it will bypass the 32bit workarounds for a slight performance increase.

Things to be aware of:

  • Listing a lot of files using workaround methods can be slower than the default PHP method. You may want to cache the results for repetitive queries.
  • Although I’m confident this class works well, I haven’t given it thorough testing on Windows or BSD (or Mac OS for that matter). Please let me know if you have issues.

Where to get it:

Be Sociable, Share!
This entry was posted by jc on Monday, September 13th, 2010 at 9:35 am and is filed under Linux, PHP. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply