php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44215 filesize() returns wrong values for files >4gb
Submitted: 2008-02-22 15:19 UTC Modified: 2008-02-23 19:56 UTC
From: php at hack-mich dot net Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.5 OS: Win Vista x64
Private report: No CVE-ID: None
 [2008-02-22 15:19 UTC] php at hack-mich dot net
Description:
------------
For files >4gb filesize returns negative values (seems that it overwrites the sign bit -> becomes negative)

Same is with 2gb files and 32bit oses, but that has not been confirmed yet. 

Reproduce code:
---------------
echo filesize('foo.bar');

//if foo.bar is > 4gb it returns a negative value

Expected result:
----------------
something like 5234556

Actual result:
--------------
something like -3456634

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-23 19:56 UTC] jani@php.net
There's already FR for this in bug #34750 no need for another report.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 01:01:30 2024 UTC