Skip to content

Instantly share code, notes, and snippets.

@TAKAyukiatkwsk
Created May 8, 2014 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TAKAyukiatkwsk/c8d38bb957020d4e0929 to your computer and use it in GitHub Desktop.
Save TAKAyukiatkwsk/c8d38bb957020d4e0929 to your computer and use it in GitHub Desktop.
net/ftp でカレントディレクトリのファイル名一覧を取得する
require 'net/ftp'
# connectionはいい感じに設定する
ftp = Net::FTP.new
ftp.connect
# ファイル名のみを取得する
ftp.ls.map {|name| name.split("\s").last }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment