#32945 [Asn->Fbk]: copy size 0 file with ftp/http wrappers

From: Date: Tue, 30 Aug 2005 11:10:10 +0000
Subject: #32945 [Asn->Fbk]: copy size 0 file with ftp/http wrappers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84186@lists.php.net to get a copy of this message
ID: 32945 Updated by: sniper@php.net Reported By: jxmaster at msn dot com -Status: Assigned +Status: Feedback Bug Type: Filesystem function related Operating System: * PHP Version: 5.0.4, 4.3.11 Assigned To: pollita New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-05-11 23:02:23] tony2001@php.net 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#84186) next »