Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.2

Bug #17901 PEAR_FTP reports error on empty files
Submitted: 2010-09-28 14:14 UTC
From: mpdude Assigned:
Status: Open Package: PEAR_RemoteInstaller
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2010-09-28 14:14 UTC] mpdude (Matthias Pigulla)
Description: ------------ For example when remote-install'ing Net_FTP, an emtpy "testfile.dat" is to be transferred. PEAR_FTP reports an error for this file although the transfer succeeded. Suggested fix: --- FTP.php.orig 2010-09-28 12:06:32.000000000 +0200 +++ FTP.php 2010-09-28 12:08:27.000000000 +0200 @@ -231,7 +231,7 @@ if ($remote) { @fclose($remote); } - return $ret ? $ret : PEAR::raiseError('FTP put of ' . $this->_prepend($remotefile) . + return ($ret || filesize($localfile) == 0) ? $ret : PEAR::raiseError('FTP put of ' . $this->_prepend($remotefile) . ' failed'); }

Comments

 [2010-09-30 03:16 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Package: PEAR +Package: PEAR_RemoteInstaller
Moving to the proper package. FTP support doesn't come native with PEAR.