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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at hack-mich dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 09:01:34 2025 UTC