Req #41643 [Opn->Sus]: ftp_size() does not return work on large files
| From: | cmb@php.net | Date: | Tue, 10 Mar 2020 09:11:20 +0000 |
| Subject: | Req #41643 [Opn->Sus]: ftp_size() does not return work on large files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225991@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=41643&edit=1
ID: 41643
Updated by: cmb@php.net
Reported by: mweber at netprovide dot com
Summary: ftp_size() does not return work on large files
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: FTP related
Operating System: SuSE Linux 10
PHP Version: 5.2.3
Block user comment: N
Private report: N
New Comment:
> 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>
Previous Comments:
------------------------------------------------------------------------
[2007-06-09 18:53:31] 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'])
------------------------------------------------------------------------
[2007-06-09 18:48:27] 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:
--------------
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=41643&edit=1