Programming Tutorials

(追記) (追記ここまで)

FTP using Ruby

By: Jeya in Ruby Tutorials on 2009年03月03日 [フレーム]

This class implements the File Transfer Protocol. If you have used a command-line FTP program, and are familiar with the commands, you will be able to use this class easily. Some extra features are included to take advantage of Ruby's style and strengths.

Example

 require 'net/ftp'

Example 1

 ftp = Net::FTP.new('ftp.netlab.co.jp')
 ftp.login
 files = ftp.chdir('pub/lang/ruby/contrib')
 files = ftp.list('n*')
 ftp.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024)
 ftp.close

Example 2

 Net::FTP.open('ftp.netlab.co.jp') do |ftp|
 ftp.login
 files = ftp.chdir('pub/lang/ruby/contrib')
 files = ftp.list('n*')
 ftp.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024)
 end



(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /