From:             j dot finlay at optusnet dot com dot au
Operating system: Linux
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  HTTP/FTP and filesize()

Description:
------------
According to the documentation, filesize() supports wrappers that also
support stat().

This seems to be false with both PHP 5.1.6, and 5.2.1-dev.

Unfortunately this function does not work as expected with FTP URLs. See
the reproducable code for an example.

However, the manual states that "As of PHP 5.0.0 this function can also be
used with some URL wrappers. Refer to Appendix M, List of Supported
Protocols/Wrappers for a listing of which wrappers support stat() family
of functionality."

>From the manual, in regards to "Appendix M, List of Supported
Protocols/Wrappers" in the "FTP and FTPS" section: "Supports stat() No As
of PHP 5.0.0: filesize(), filetype(), file_exists(), is_file(), and
is_dir() elements only. As of PHP 5.1.0: filemtime()."

Reproduce code:
---------------
<?php
print
filesize("http://au2.php.net/distributions/php-5.2.0.tar.bz2";)."\n";
?>

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

Actual result:
--------------
Warning: filesize(): stat failed for
http://au2.php.net/distributions/php-5.2.0.tar.bz2

-- 
Edit bug report at http://bugs.php.net/?id=39475&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39475&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39475&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39475&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39475&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39475&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39475&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39475&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39475&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39475&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39475&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39475&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39475&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39475&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39475&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39475&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39475&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39475&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39475&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39475&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39475&r=mysqlcfg

Reply via email to