Last active
November 13, 2018 11:37
-
-
Save SunDi3yansyah/e64efc61ac5441fe646e2c19cbb2992b to your computer and use it in GitHub Desktop.
Download File on FTP Server with Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
okoce