Class Net::FTP
In: lib/net/ftp-netrc.rb
Parent: Object

Methods

login  

External Aliases

connect -> orig_connect
login -> orig_login

Public Instance methods

Logs in to the remote host. The session must have been previously connected.

If user is nil, Net::Netrc#locate is used to lookup login information based on the host name supplied when the connection was established.

If user is the string "anonymous" and the password is nil, a password of user@host is synthesized. If the acct parameter is not nil, an FTP ACCT command is sent following the successful login. Raises an exception on error (typically Net::FTPPermError).

Example:

  require 'net/ftp-netrc'     # (brings in net/ftp and net/netrc)

  ftp = Net::FTP.new('myhost')
  ftp.login(nil)
  ftp.last_response
  => 230 User myuser logged in.

[Validate]