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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Thu Dec 26 18:01:31 2024 UTC