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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jxmaster at msn dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 13:01:27 2024 UTC