| abort |
Aborts the previous command (ABOR command).
|
| acct |
Sends the ACCT command. TODO: more info.
|
| chdir |
Changes the (remote) directory.
|
| close |
Closes the connection. Further operations are impossible until you open a
new connection with #connect.
|
| closed? |
Returns true iff the connection is closed.
|
| connect |
Establishes an FTP connection to host, optionally overriding the default
port. If the environment variable SOCKS_SERVER is set, sets up the
connection through a SOCKS proxy. Raises an exception (typically
Errno::ECONNREFUSED) if the connection cannot be established.
|
| delete |
Deletes a file on the server.
|
| dir |
Alias for #list
|
| get |
Retrieves remotefile in whatever mode the session is set (text or
binary). See #gettextfile and #getbinaryfile.
|
| getbinaryfile |
Retrieves remotefile in binary mode, storing the result in
localfile. If a block is supplied, it is passed the retrieved data
in blocksize chunks.
|
| getdir |
Alias for #pwd
|
| gettextfile |
Retrieves remotefile in ASCII (text) mode, storing the result in
localfile. If a block is supplied, it is passed the retrieved data
one line at a time.
|
| help |
Issues the HELP command.
|
| list |
Returns an array of file information in the directory (the output is like
`ls -l`). If a block is given, it iterates through the listing.
|
| login |
Logs in to the remote host. The session must have been previously
connected. 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).
|
| ls |
Alias for #list
|
| mdtm |
Issues the MDTM command. TODO: more info.
|
| mkdir |
Creates a remote directory.
|
| mtime |
Returns the last modification time of the (remote) file. If local
is true, it is returned as a local time, otherwise it’s a
UTC time.
|
| new |
Creates and returns a new FTP object. If a host is given,
a connection is made. Additionally, if the user is given, the
given user name, password, and (optionally) account are used to log in. See
#login.
|
| nlst |
Returns an array of filenames in the remote directory.
|
| noop |
Issues a NOOP command.
|
| open |
A synonym for FTP.new, but with a mandatory host parameter.
|
| put |
Transfers localfile to the server in whatever mode the session is
set (text or binary). See #puttextfile and #putbinaryfile.
|
| putbinaryfile |
Transfers localfile to the server in binary mode, storing the
result in remotefile. If a block is supplied, calls it, passing in
the transmitted data in blocksize chunks.
|
| puttextfile |
Transfers localfile to the server in ASCII (text) mode, storing
the result in remotefile. If callback or an associated block is
supplied, calls it, passing in the transmitted data one line at a time.
|
| pwd |
Returns the current remote directory.
|
| quit |
Exits the FTP session.
|
| rename |
Renames a file on the server.
|
| retrbinary |
Puts the connection into binary (image) mode, issues the given command, and
fetches the data returned, passing it to the associated block in chunks of
blocksize characters. Note that cmd is a server command
(such as "RETR myfile").
|
| retrlines |
Puts the connection into ASCII (text) mode, issues the given command, and
passes the resulting data, one line at a time, to the associated block. If
no block is given, prints the lines. Note that cmd is a server
command (such as "RETR myfile").
|
| return_code |
Obsolete
|
| return_code= |
Obsolete
|
| rmdir |
Removes a remote directory.
|
| sendcmd |
Sends a command and returns the response.
|
| set_socket |
WRITEME or make private
|
| site |
Issues a SITE command.
|
| size |
Returns the size of the given (remote) filename.
|
| status |
Returns the status (STAT command).
|
| storbinary |
Puts the connection into binary (image) mode, issues the given server-side
command (such as "STOR myfile"), and sends the contents of the
file named file to the server. If the optional block is given, it
also passes it the data, in chunks of blocksize characters.
|
| storlines |
Puts the connection into ASCII (text) mode, issues the given server-side
command (such as "STOR myfile"), and sends the contents of the
file named file to the server, one line at a time. If the optional
block is given, it also passes it the lines.
|
| system |
Returns system information.
|
| voidcmd |
Sends a command and expect a response beginning with ‘2’.
|
<code/>and<pre/>for code samples.