Skip to content

Instantly share code, notes, and snippets.

@SunDi3yansyah
Last active November 13, 2018 11:37
Show Gist options
  • Save SunDi3yansyah/e64efc61ac5441fe646e2c19cbb2992b to your computer and use it in GitHub Desktop.
Save SunDi3yansyah/e64efc61ac5441fe646e2c19cbb2992b to your computer and use it in GitHub Desktop.
Download File on FTP Server with Ruby
# Ref: https://ruby-doc.org/stdlib-2.5.3/libdoc/net/ftp/rdoc/Net/FTP.html
require 'net/ftp'
Net::FTP.open('ftp.gnu.org') do |ftp|
ftp.login
ftp.chdir('gnu/wget')
nlst = ftp.nlst('*.tar.gz')
nlst.map {|file_name| ftp.gettextfile(file_name) }
end
@wtf666
Copy link

wtf666 commented Nov 11, 2018

okoce

@wicky-andrian
Copy link

siaaap mastah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment