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

Bug #5337 _list_and_parse behavior with an empty remote directory
Submitted: 2005-09-08 13:56 UTC
From: nkahn at cmd dot lu Assigned: toby
Status: Closed Package: Net_FTP
PHP Version: 4.3.10 OS: Debian Sarge
Roadmaps: (Not assigned)    
Subscription  


 [2005-09-08 13:56 UTC] nkahn at cmd dot lu
Description: ------------ Hello, I have a question regarding the way to modify "_list_and_parse" function to handle my FTP server behavior with empty directory. Indeed in that case the FTP server returns the string "total 0" to indicate that there is no file in it. The problem is that the result of "ftp_rawlist" function is no more an empty array but an array with one element as described below. So "_list_and_parse" function tries to find a match with an OS specification and can't since there is no match defined in attribute "_ls_match". Should I implement such a matching pattern in attribute "_ls_match" or is there another way to handle it ? Thanks for your help. Nicolas Kahn Test script: --------------- // set up basic connection $conn_id = ftp_connect(FTP_HOST); // login with username and password $login_result = ftp_login($conn_id, FTP_USERNAME, FTP_PASSWORD); // get the file list $buff = ftp_rawlist($conn_id, FTP_REMOTE_PATH); // output the buffer echo "ftp_rawlist: ", var_dump($buff), "\n"; // close the connection ftp_close($conn_id); Expected result: ---------------- ftp_rawlist: array(0) { } Actual result: -------------- ftp_rawlist: array(1) { [0]=> string(7) "total 0" }

Comments

 [2006-02-09 23:05 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!