#32945 [Asn]: copy size 0 file with ftp wrapper
| From: | tony2001@php.net | Date: | Wed, 11 May 2005 21:02:24 +0000 |
| Subject: | #32945 [Asn]: copy size 0 file with ftp wrapper | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78910@lists.php.net to get a copy of this message | ||
ID: 32945
Updated by: tony2001@php.net
Reported By: jxmaster at msn dot com
Status: Assigned
Bug Type: Filesystem function related
Operating System: freebsd4.3,windowsxp,linux9.0
PHP Version: 4.3.11
Assigned To: pollita
New Comment:
The very same situation exists with http wrapper.
The problem is that php_stream_copy_to_stream() returns 0 on error and
we can't distinguish zero-length file from error if there is no stat()
for current wrapper.
Previous Comments:
------------------------------------------------------------------------
[2005-05-10 15:17:35] sniper@php.net
Sara, you're most familiar with this.. (this propably happens in PHP 5
too)
------------------------------------------------------------------------
[2005-05-04 17:28:47] jxmaster at msn dot com
Description:
------------
copy('ftp://username:password@ip/path/filename',
'tmp.dat');
If the file in the ftp server has size 0, the copy statment returned
false. However, the file tmp.dat was created with size 0.
copy ('localfile', 'tmp.dat') worked well.
Reproduce code:
---------------
copy('ftp://username:password@ip/path/filename',
'tmp.dat');
Expected result:
----------------
The file tmp.dat is created in the current directory with file zero and
gets a TRUE return.
Actual result:
--------------
The file tmp.dat is created in the current directory with file zero,
but gets a FALSE return.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32945&edit=1