php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41643 ftp_size() does not return work on large files
Submitted: 2007-06-09 18:48 UTC Modified: 2020-03-10 09:11 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: mweber at netprovide dot com Assigned:
Status: Suspended Package: FTP related
PHP Version: 5.2.3 OS: SuSE Linux 10
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: mweber at netprovide dot com
New email:
PHP Version: OS:

 

 [2007-06-09 18:48 UTC] mweber at netprovide dot com
Description:
------------
ftp_size() does not work on files lager than 2GB...

I know, that PHP is limited to handle just 32bit integer values...

My Idea would be, that you alter this function to:

float ftp_size ( resource $ftp_stream, string $remote_file [, int $unit='B'])

where $unit can be:
  GB
  MB
  KB
  B

you just need to change the return value to float and calculate the internal "string"(size) to the value requested...

this would produce smaller numbers...

Reproduce code:
---------------
 

Expected result:
----------------
 

Actual result:
--------------
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-09 18:53 UTC] mweber2 at netprovide dot com
well it should be a string instead of int for the additional argument

float ftp_size ( resource $ftp_stream, string $remote_file [, string
$unit='B'])
 [2011-02-21 21:03 UTC] jani@php.net
-Package: Feature/Change Request +Package: FTP related
 [2020-03-10 09:11 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2020-03-10 09:11 UTC] cmb@php.net
> I know, that PHP is limited to handle just 32bit integer
> values...

Besides that, as of PHP 7.0.0, this limitation no longer applies
to any of the supported 64bit architectures, I don't think that
special casing ftp_size() (but not related functions like
filesize()) makes any sense.  In any way, that would need
discussion on the internals mailing list[1].  Feel free to write
to the list; for the time being I'm suspending this ticket.

[1] <https://www.php.net/mailing-lists.php#internals>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 08:01:28 2024 UTC