-
FAQ
- Forum Search
- Community
- Online Manual
- Support Helpers of the Month
- Function Database
ftp_connection::list_dir
Description
Retrieves a directory listing for the specified directory.
Syntax
string ftp_connection::list_dir ([string $ftp_path[, bool $search]])
Parameter $ftp_path
Expected type: String
Description: The path to a directory (other than the current one) to get the listing for
Parameter $search
Expected type: Boolean
Description: If true, will do a recursive listing showing the contents of any subdirectories as well. Default is false.
Return value
Expected type: String
Description: The directory listing returned by FTP, or false if the listing could not be retrieved
Notes
- Example: $package_ftp->list_dir('/public_html');
- Sends the "LIST -1" command to the server ("1" means list 1 file per line)
- Appends "R" flag to the above command if $search is true ("R" = recursive)
- Checks for either a 150 or 226 response code
- Sets a 'bad_response' error, attempts to close the passive connection and returns false if the response code isn't 150 or 226
Advertisement:- Help | Terms and Rules | Go Up ▲
- Copyright © 2022 Simple Machines. All Rights Reserved.
- Page created in 0.119 seconds with 13 queries.
- Forum Search