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');
 
var ftp = %s'Net::FTP'.new('ftp.ed.ac.uk', Passive => 1);
ftp.login('anonymous','aaa@gmail.com');
ftp.cwd('pub/courses');
[ftp.dir].each {|line| say line };
ftp.binary;   # set binary mode
ftp.get("make.notes.tar");
ftp.quit;