Created
February 28, 2014 06:34
-
-
Save TAKAyukiatkwsk/9266385 to your computer and use it in GitHub Desktop.
Net::FTPクラスを使ってみる
This file contains 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
require 'net/ftp' | |
ftp = Net::FTP.new | |
ftp.connect('hostname', 21) # port番号はdefaultで21(省略可能) | |
ftp.login('username', 'password') | |
ftp.passive | |
#=> true or false | |
ftp.passive = true | |
ftp.list | |
#=> ["-rw-r--r-- 1 0 0 1234 Feb 27 13:36 aaa.txt", | |
# "-rw-r--r-- 1 0 0 2345 Aug 15 2013 bbb.txt"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment