Task
Connect to a server, change directory, list its contents and download a file as binary using the FTP protocol. Use passive mode if available.




require 'net/ftp'
 
Net::FTP.open('ftp.ed.ac.uk', "anonymous","aaa@gmail.com" ) do |ftp|
  ftp.passive = true  # default since Ruby 2.3
  ftp.chdir('pub/courses')
  puts ftp.list
  ftp.getbinaryfile("make.notes.tar")
end