I am not sure what I am missing, but I have FTP connection that I have to download the contents (if any). I run the following code:
connection.nlst('*.*').each do |entry|
connection.getbinaryfile(entry, downloaded_file_path)
end
The problem is when the folder is empty, it raises Net::FTPPermError Exception: 550 *: No such file or directory.
. But when the folder has content, it works just fine.
I am not sure what to try, but here is some of the output to show that the connection is working:
> connection.list
["total 0"]
> connection.pwd
"/ftp/pub/Responses"
> connection.nlst
Net::FTPPermError Exception: 550 *: No such file or directory.
I would expect nlst to return an empty array, not raise an exception?