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

Bug #7527 ls fails if there isn't a file/directory
Submitted: 2006-04-30 17:16 UTC
From: uwelk at xhochy dot org Assigned: jorrit
Status: Closed Package: Net_FTP (version 1.3.2)
PHP Version: 5.1.2 OS: Suse Linux 9.3
Roadmaps: 1.3.3    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2007-11-24 19:50 UTC
Package:
Bug Type:
Summary:
From: uwelk at xhochy dot org
New email:
PHP Version: Package Version: OS:

 

 [2006-04-30 17:16 UTC] uwelk at xhochy dot org (Uwe L. Korn)
Description: ------------ Simply if you make an ls on an empty folder you get an error: The list style of your server seems not to be supported. I use the following commands below, both return a PEAR::Error Test script: --------------- $arr1 = $connection->ls($path,NET_FTP_FILES_ONLY); $arr2 = $connection->ls($path,NET_FTP_DIRS_ONLY); Expected result: ---------------- an array with the length 0 Actual result: -------------- object(PEAR_Error)#5 (8) { ["error_message_prefix"]=> string(0) "" ["mode"]=> int(1) ["level"]=> int(1024) ["code"]=> int(-31) ["message"]=> string(208) "The list style of your server seems not to be supported. Please email a "$ftp->ls(NET_FTP_RAWLIST);" output plus info on the server to the maintainer of this package to get it supported! Thanks for your help!" ["userinfo"]=> NULL ["backtrace"]=> //not more because password should behiddeen and coming data > 1MB

Comments

 [2006-04-30 17:18 UTC] uwelk at xhochy dot org
Output from "$ftp->ls(NET_FTP_RAWLIST);" ---------------------------------------- array(1) { [0]=> string(7) "total 0" }
 [2007-03-11 10:43 UTC] mj (Martin Jansen)
Works just fine for me with PHP 5.2.0 and the latest version of Net_FTP. Which server are you using that causes this problem? Can you please try upgrading to PHP 5.2.0? Thanks!
 [2007-03-11 10:51 UTC] uwelk at xhochy dot org
I'm not using it anymore, but I connected to a muddleftpd, version 1.3.13.1-4(on debian sarge) PS: It should work with older PHP-versions too.
 [2007-03-11 18:20 UTC] mj (Martin Jansen)
I can verify the issue with muddleftpd 1.3.13.1-4 (Debian sarge), PHP 5.2.0 and Net_FTP 1.3.2.
 [2007-03-11 18:29 UTC] mj (Martin Jansen)
Net_FTP::_determine_os_match() fails because it cannot determine which operating system is used, because $dir_list is empty. I'll leave fixing this up to Tobias :). Also one should get rid of this odd pass-by-reference of $dir_list, because it is not necessary at all.
 [2007-11-16 21:40 UTC] jorrit (Jorrit Schippers)
Empty directories are being caught by a condition, but in this case there was a total line, which caused the array to be non-empty. Those total lines should be filtered.
 [2007-11-24 19:50 UTC] jorrit (Jorrit Schippers)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.