php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32945 copy size 0 file with ftp/http wrappers
Submitted: 2005-05-04 17:28 UTC Modified: 2005-09-07 01:00 UTC
From: jxmaster at msn dot com Assigned: pollita (profile)
Status: No Feedback Package: Filesystem function related
PHP Version: 5.0.4, 4.3.11 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
50 + 4 = ?
Subscribe to this entry?

 
 [2005-05-04 17:28 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-10 15:17 UTC] sniper@php.net
Sara, you're most familiar with this.. (this propably happens in PHP 5 too)

 [2005-05-11 23:02 UTC] 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-08-30 13:10 UTC] sniper@php.net
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


 [2005-09-07 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 21:01:41 2019 UTC