Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / man / man3 / Net::FTP.3
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Net::FTP 3"
.TH Net::FTP 3 "2001-09-21" "perl v5.8.8" "Perl Programmers Reference Guide"
.SH "NAME"
Net::FTP \- FTP Client class
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Net::FTP;
.Ve
.PP
.Vb 2
\& $ftp = Net::FTP->new("some.host.name", Debug => 0)
\& or die "Cannot connect to some.host.name: $@";
.Ve
.PP
.Vb 2
\& $ftp->login("anonymous",'-anonymous@')
\& or die "Cannot login ", $ftp->message;
.Ve
.PP
.Vb 2
\& $ftp->cwd("/pub")
\& or die "Cannot change working directory ", $ftp->message;
.Ve
.PP
.Vb 2
\& $ftp->get("that.file")
\& or die "get failed ", $ftp->message;
.Ve
.PP
.Vb 1
\& $ftp->quit;
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\f(CW\*(C`Net::FTP\*(C'\fR is a class implementing a simple \s-1FTP\s0 client in Perl as
described in \s-1RFC959\s0. It provides wrappers for a subset of the \s-1RFC959\s0
commands.
.SH "OVERVIEW"
.IX Header "OVERVIEW"
\&\s-1FTP\s0 stands for File Transfer Protocol. It is a way of transferring
files between networked machines. The protocol defines a client
(whose commands are provided by this module) and a server (not
implemented in this module). Communication is always initiated by the
client, and the server responds with a message and a status code (and
sometimes with data).
.PP
The \s-1FTP\s0 protocol allows files to be sent to or fetched from the
server. Each transfer involves a \fBlocal file\fR (on the client) and a
\&\fBremote file\fR (on the server). In this module, the same file name
will be used for both local and remote if only one is specified. This
means that transferring remote file \f(CW\*(C`/path/to/file\*(C'\fR will try to put
that file in \f(CW\*(C`/path/to/file\*(C'\fR locally, unless you specify a local file
name.
.PP
The protocol also defines several standard \fBtranslations\fR which the
file can undergo during transfer. These are \s-1ASCII\s0, \s-1EBCDIC\s0, binary,
and byte. \s-1ASCII\s0 is the default type, and indicates that the sender of
files will translate the ends of lines to a standard representation
which the receiver will then translate back into their local
representation. \s-1EBCDIC\s0 indicates the file being transferred is in
\&\s-1EBCDIC\s0 format. Binary (also known as image) format sends the data as
a contiguous bit stream. Byte format transfers the data as bytes, the
values of which remain the same regardless of differences in byte size
between the two machines (in theory \- in practice you should only use
this if you really know what you're doing).
.SH "CONSTRUCTOR"
.IX Header "CONSTRUCTOR"
.IP "new ([ \s-1HOST\s0 ] [, \s-1OPTIONS\s0 ])" 4
.IX Item "new ([ HOST ] [, OPTIONS ])"
This is the constructor for a new Net::FTP object. \f(CW\*(C`HOST\*(C'\fR is the
name of the remote host to which an \s-1FTP\s0 connection is required.
.Sp
\&\f(CW\*(C`HOST\*(C'\fR is optional. If \f(CW\*(C`HOST\*(C'\fR is not given then it may instead be
passed as the \f(CW\*(C`Host\*(C'\fR option described below.
.Sp
\&\f(CW\*(C`OPTIONS\*(C'\fR are passed in a hash like fashion, using key and value pairs.
Possible options are:
.Sp
\&\fBHost\fR \- \s-1FTP\s0 host to connect to. It may be a single scalar, as defined for
the \f(CW\*(C`PeerAddr\*(C'\fR option in IO::Socket::INET, or a reference to
an array with hosts to try in turn. The \*(L"host\*(R" method will return the value
which was used to connect to the host.
.Sp
\&\fBFirewall\fR \- The name of a machine which acts as an \s-1FTP\s0 firewall. This can be
overridden by an environment variable \f(CW\*(C`FTP_FIREWALL\*(C'\fR. If specified, and the
given host cannot be directly connected to, then the
connection is made to the firewall machine and the string \f(CW@hostname\fR is
appended to the login identifier. This kind of setup is also refered to
as an ftp proxy.
.Sp
\&\fBFirewallType\fR \- The type of firewall running on the machine indicated by
\&\fBFirewall\fR. This can be overridden by an environment variable
\&\f(CW\*(C`FTP_FIREWALL_TYPE\*(C'\fR. For a list of permissible types, see the description of
ftp_firewall_type in Net::Config.
.Sp
\&\fBBlockSize\fR \- This is the block size that Net::FTP will use when doing
transfers. (defaults to 10240)
.Sp
\&\fBPort\fR \- The port number to connect to on the remote machine for the
\&\s-1FTP\s0 connection
.Sp
\&\fBTimeout\fR \- Set a timeout value (defaults to 120)
.Sp
\&\fBDebug\fR \- debug level (see the debug method in Net::Cmd)
.Sp
\&\fBPassive\fR \- If set to a non-zero value then all data transfers will be done
using passive mode. This is not usually required except for some \fIdumb\fR
servers, and some firewall configurations. This can also be set by the
environment variable \f(CW\*(C`FTP_PASSIVE\*(C'\fR.
.Sp
\&\fBHash\fR \- If given a reference to a file handle (e.g., \f(CW\*(C`\e*STDERR\*(C'\fR),
print hash marks (#) on that filehandle every 1024 bytes. This
simply invokes the \f(CW\*(C`hash()\*(C'\fR method for you, so that hash marks
are displayed for all transfers. You can, of course, call \f(CW\*(C`hash()\*(C'\fR
explicitly whenever you'd like.
.Sp
\&\fBLocalAddr\fR \- Local address to use for all socket connections, this
argument will be passed to IO::Socket::INET
.Sp
If the constructor fails undef will be returned and an error message will
be in $@
.SH "METHODS"
.IX Header "METHODS"
Unless otherwise stated all methods return either a \fItrue\fR or \fIfalse\fR
value, with \fItrue\fR meaning that the operation was a success. When a method
states that it returns a value, failure will be returned as \fIundef\fR or an
empty list.
.IP "login ([\s-1LOGIN\s0 [,PASSWORD [, \s-1ACCOUNT\s0] ] ])" 4
.IX Item "login ([LOGIN [,PASSWORD [, ACCOUNT] ] ])"
Log into the remote \s-1FTP\s0 server with the given login information. If
no arguments are given then the \f(CW\*(C`Net::FTP\*(C'\fR uses the \f(CW\*(C`Net::Netrc\*(C'\fR
package to lookup the login information for the connected host.
If no information is found then a login of \fIanonymous\fR is used.
If no password is given and the login is \fIanonymous\fR then \fIanonymous@\fR
will be used for password.
.Sp
If the connection is via a firewall then the \f(CW\*(C`authorize\*(C'\fR method will
be called with no arguments.
.IP "authorize ( [\s-1AUTH\s0 [, \s-1RESP\s0]])" 4
.IX Item "authorize ( [AUTH [, RESP]])"
This is a protocol used by some firewall ftp proxies. It is used
to authorise the user to send data out. If both arguments are not specified
then \f(CW\*(C`authorize\*(C'\fR uses \f(CW\*(C`Net::Netrc\*(C'\fR to do a lookup.
.IP "site (\s-1ARGS\s0)" 4
.IX Item "site (ARGS)"
Send a \s-1SITE\s0 command to the remote server and wait for a response.
.Sp
Returns most significant digit of the response code.
.IP "ascii" 4
.IX Item "ascii"
Transfer file in \s-1ASCII\s0. \s-1CRLF\s0 translation will be done if required
.IP "binary" 4
.IX Item "binary"
Transfer file in binary mode. No transformation will be done.
.Sp
\&\fBHint\fR: If both server and client machines use the same line ending for
text files, then it will be faster to transfer all files in binary mode.
.IP "rename ( \s-1OLDNAME\s0, \s-1NEWNAME\s0 )" 4
.IX Item "rename ( OLDNAME, NEWNAME )"
Rename a file on the remote \s-1FTP\s0 server from \f(CW\*(C`OLDNAME\*(C'\fR to \f(CW\*(C`NEWNAME\*(C'\fR. This
is done by sending the \s-1RNFR\s0 and \s-1RNTO\s0 commands.
.IP "delete ( \s-1FILENAME\s0 )" 4
.IX Item "delete ( FILENAME )"
Send a request to the server to delete \f(CW\*(C`FILENAME\*(C'\fR.
.IP "cwd ( [ \s-1DIR\s0 ] )" 4
.IX Item "cwd ( [ DIR ] )"
Attempt to change directory to the directory given in \f(CW$dir\fR. If
\&\f(CW$dir\fR is \f(CW".."\fR, the \s-1FTP\s0 \f(CW\*(C`CDUP\*(C'\fR command is used to attempt to
move up one directory. If no directory is given then an attempt is made
to change the directory to the root directory.
.IP "cdup ()" 4
.IX Item "cdup ()"
Change directory to the parent of the current directory.
.IP "pwd ()" 4
.IX Item "pwd ()"
Returns the full pathname of the current directory.
.IP "restart ( \s-1WHERE\s0 )" 4
.IX Item "restart ( WHERE )"
Set the byte offset at which to begin the next data transfer. Net::FTP simply
records this value and uses it when during the next data transfer. For this
reason this method will not return an error, but setting it may cause
a subsequent data transfer to fail.
.IP "rmdir ( \s-1DIR\s0 [, \s-1RECURSE\s0 ])" 4
.IX Item "rmdir ( DIR [, RECURSE ])"
Remove the directory with the name \f(CW\*(C`DIR\*(C'\fR. If \f(CW\*(C`RECURSE\*(C'\fR is \fItrue\fR then
\&\f(CW\*(C`rmdir\*(C'\fR will attempt to delete everything inside the directory.
.IP "mkdir ( \s-1DIR\s0 [, \s-1RECURSE\s0 ])" 4
.IX Item "mkdir ( DIR [, RECURSE ])"
Create a new directory with the name \f(CW\*(C`DIR\*(C'\fR. If \f(CW\*(C`RECURSE\*(C'\fR is \fItrue\fR then
\&\f(CW\*(C`mkdir\*(C'\fR will attempt to create all the directories in the given path.
.Sp
Returns the full pathname to the new directory.
.IP "alloc ( \s-1SIZE\s0 [, \s-1RECORD_SIZE\s0] )" 4
.IX Item "alloc ( SIZE [, RECORD_SIZE] )"
The alloc command allows you to give the ftp server a hint about the size
of the file about to be transfered using the \s-1ALLO\s0 ftp command. Some storage
systems use this to make intelligent decisions about how to store the file.
The \f(CW\*(C`SIZE\*(C'\fR argument represents the size of the file in bytes. The
\&\f(CW\*(C`RECORD_SIZE\*(C'\fR argument indicates a mazimum record or page size for files
sent with a record or page structure.
.Sp
The size of the file will be determined, and sent to the server
automatically for normal files so that this method need only be called if
you are transfering data from a socket, named pipe, or other stream not
associated with a normal file.
.IP "ls ( [ \s-1DIR\s0 ] )" 4
.IX Item "ls ( [ DIR ] )"
Get a directory listing of \f(CW\*(C`DIR\*(C'\fR, or the current directory.
.Sp
In an array context, returns a list of lines returned from the server. In
a scalar context, returns a reference to a list.
.IP "dir ( [ \s-1DIR\s0 ] )" 4
.IX Item "dir ( [ DIR ] )"
Get a directory listing of \f(CW\*(C`DIR\*(C'\fR, or the current directory in long format.
.Sp
In an array context, returns a list of lines returned from the server. In
a scalar context, returns a reference to a list.
.IP "get ( \s-1REMOTE_FILE\s0 [, \s-1LOCAL_FILE\s0 [, \s-1WHERE\s0]] )" 4
.IX Item "get ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] )"
Get \f(CW\*(C`REMOTE_FILE\*(C'\fR from the server and store locally. \f(CW\*(C`LOCAL_FILE\*(C'\fR may be
a filename or a filehandle. If not specified, the file will be stored in
the current directory with the same leafname as the remote file.
.Sp
If \f(CW\*(C`WHERE\*(C'\fR is given then the first \f(CW\*(C`WHERE\*(C'\fR bytes of the file will
not be transfered, and the remaining bytes will be appended to
the local file if it already exists.
.Sp
Returns \f(CW\*(C`LOCAL_FILE\*(C'\fR, or the generated local file name if \f(CW\*(C`LOCAL_FILE\*(C'\fR
is not given. If an error was encountered undef is returned.
.IP "put ( \s-1LOCAL_FILE\s0 [, \s-1REMOTE_FILE\s0 ] )" 4
.IX Item "put ( LOCAL_FILE [, REMOTE_FILE ] )"
Put a file on the remote server. \f(CW\*(C`LOCAL_FILE\*(C'\fR may be a name or a filehandle.
If \f(CW\*(C`LOCAL_FILE\*(C'\fR is a filehandle then \f(CW\*(C`REMOTE_FILE\*(C'\fR must be specified. If
\&\f(CW\*(C`REMOTE_FILE\*(C'\fR is not specified then the file will be stored in the current
directory with the same leafname as \f(CW\*(C`LOCAL_FILE\*(C'\fR.
.Sp
Returns \f(CW\*(C`REMOTE_FILE\*(C'\fR, or the generated remote filename if \f(CW\*(C`REMOTE_FILE\*(C'\fR
is not given.
.Sp
\&\fB\s-1NOTE\s0\fR: If for some reason the transfer does not complete and an error is
returned then the contents that had been transfered will not be remove
automatically.
.IP "put_unique ( \s-1LOCAL_FILE\s0 [, \s-1REMOTE_FILE\s0 ] )" 4
.IX Item "put_unique ( LOCAL_FILE [, REMOTE_FILE ] )"
Same as put but uses the \f(CW\*(C`STOU\*(C'\fR command.
.Sp
Returns the name of the file on the server.
.IP "append ( \s-1LOCAL_FILE\s0 [, \s-1REMOTE_FILE\s0 ] )" 4
.IX Item "append ( LOCAL_FILE [, REMOTE_FILE ] )"
Same as put but appends to the file on the remote server.
.Sp
Returns \f(CW\*(C`REMOTE_FILE\*(C'\fR, or the generated remote filename if \f(CW\*(C`REMOTE_FILE\*(C'\fR
is not given.
.IP "unique_name ()" 4
.IX Item "unique_name ()"
Returns the name of the last file stored on the server using the
\&\f(CW\*(C`STOU\*(C'\fR command.
.IP "mdtm ( \s-1FILE\s0 )" 4
.IX Item "mdtm ( FILE )"
Returns the \fImodification time\fR of the given file
.IP "size ( \s-1FILE\s0 )" 4
.IX Item "size ( FILE )"
Returns the size in bytes for the given file as stored on the remote server.
.Sp
\&\fB\s-1NOTE\s0\fR: The size reported is the size of the stored file on the remote server.
If the file is subsequently transfered from the server in \s-1ASCII\s0 mode
and the remote server and local machine have different ideas about
\&\*(L"End Of Line\*(R" then the size of file on the local machine after transfer
may be different.
.IP "supported ( \s-1CMD\s0 )" 4
.IX Item "supported ( CMD )"
Returns \s-1TRUE\s0 if the remote server supports the given command.
.IP "hash ( [\s-1FILEHANDLE_GLOB_REF\s0],[ \s-1BYTES_PER_HASH_MARK\s0] )" 4
.IX Item "hash ( [FILEHANDLE_GLOB_REF],[ BYTES_PER_HASH_MARK] )"
Called without parameters, or with the first argument false, hash marks
are suppressed. If the first argument is true but not a reference to a
file handle glob, then \e*STDERR is used. The second argument is the number
of bytes per hash mark printed, and defaults to 1024. In all cases the
return value is a reference to an array of two: the filehandle glob reference
and the bytes per hash mark.
.PP
The following methods can return different results depending on
how they are called. If the user explicitly calls either
of the \f(CW\*(C`pasv\*(C'\fR or \f(CW\*(C`port\*(C'\fR methods then these methods will
return a \fItrue\fR or \fIfalse\fR value. If the user does not
call either of these methods then the result will be a
reference to a \f(CW\*(C`Net::FTP::dataconn\*(C'\fR based object.
.IP "nlst ( [ \s-1DIR\s0 ] )" 4
.IX Item "nlst ( [ DIR ] )"
Send an \f(CW\*(C`NLST\*(C'\fR command to the server, with an optional parameter.
.IP "list ( [ \s-1DIR\s0 ] )" 4
.IX Item "list ( [ DIR ] )"
Same as \f(CW\*(C`nlst\*(C'\fR but using the \f(CW\*(C`LIST\*(C'\fR command
.IP "retr ( \s-1FILE\s0 )" 4
.IX Item "retr ( FILE )"
Begin the retrieval of a file called \f(CW\*(C`FILE\*(C'\fR from the remote server.
.IP "stor ( \s-1FILE\s0 )" 4
.IX Item "stor ( FILE )"
Tell the server that you wish to store a file. \f(CW\*(C`FILE\*(C'\fR is the
name of the new file that should be created.
.IP "stou ( \s-1FILE\s0 )" 4
.IX Item "stou ( FILE )"
Same as \f(CW\*(C`stor\*(C'\fR but using the \f(CW\*(C`STOU\*(C'\fR command. The name of the unique
file which was created on the server will be available via the \f(CW\*(C`unique_name\*(C'\fR
method after the data connection has been closed.
.IP "appe ( \s-1FILE\s0 )" 4
.IX Item "appe ( FILE )"
Tell the server that we want to append some data to the end of a file
called \f(CW\*(C`FILE\*(C'\fR. If this file does not exist then create it.
.PP
If for some reason you want to have complete control over the data connection,
this includes generating it and calling the \f(CW\*(C`response\*(C'\fR method when required,
then the user can use these methods to do so.
.PP
However calling these methods only affects the use of the methods above that
can return a data connection. They have no effect on methods \f(CW\*(C`get\*(C'\fR, \f(CW\*(C`put\*(C'\fR,
\&\f(CW\*(C`put_unique\*(C'\fR and those that do not require data connections.
.IP "port ( [ \s-1PORT\s0 ] )" 4
.IX Item "port ( [ PORT ] )"
Send a \f(CW\*(C`PORT\*(C'\fR command to the server. If \f(CW\*(C`PORT\*(C'\fR is specified then it is sent
to the server. If not, then a listen socket is created and the correct information
sent to the server.
.IP "pasv ()" 4
.IX Item "pasv ()"
Tell the server to go into passive mode. Returns the text that represents the
port on which the server is listening, this text is in a suitable form to
sent to another ftp server using the \f(CW\*(C`port\*(C'\fR method.
.PP
The following methods can be used to transfer files between two remote
servers, providing that these two servers can connect directly to each other.
.IP "pasv_xfer ( \s-1SRC_FILE\s0, \s-1DEST_SERVER\s0 [, \s-1DEST_FILE\s0 ] )" 4
.IX Item "pasv_xfer ( SRC_FILE, DEST_SERVER [, DEST_FILE ] )"
This method will do a file transfer between two remote ftp servers. If
\&\f(CW\*(C`DEST_FILE\*(C'\fR is omitted then the leaf name of \f(CW\*(C`SRC_FILE\*(C'\fR will be used.
.IP "pasv_xfer_unique ( \s-1SRC_FILE\s0, \s-1DEST_SERVER\s0 [, \s-1DEST_FILE\s0 ] )" 4
.IX Item "pasv_xfer_unique ( SRC_FILE, DEST_SERVER [, DEST_FILE ] )"
Like \f(CW\*(C`pasv_xfer\*(C'\fR but the file is stored on the remote server using
the \s-1STOU\s0 command.
.IP "pasv_wait ( \s-1NON_PASV_SERVER\s0 )" 4
.IX Item "pasv_wait ( NON_PASV_SERVER )"
This method can be used to wait for a transfer to complete between a passive
server and a non-passive server. The method should be called on the passive
server with the \f(CW\*(C`Net::FTP\*(C'\fR object for the non-passive server passed as an
argument.
.IP "abort ()" 4
.IX Item "abort ()"
Abort the current data transfer.
.IP "quit ()" 4
.IX Item "quit ()"
Send the \s-1QUIT\s0 command to the remote \s-1FTP\s0 server and close the socket connection.
.Sh "Methods for the adventurous"
.IX Subsection "Methods for the adventurous"
\&\f(CW\*(C`Net::FTP\*(C'\fR inherits from \f(CW\*(C`Net::Cmd\*(C'\fR so methods defined in \f(CW\*(C`Net::Cmd\*(C'\fR may
be used to send commands to the remote \s-1FTP\s0 server.
.IP "quot (\s-1CMD\s0 [,ARGS])" 4
.IX Item "quot (CMD [,ARGS])"
Send a command, that Net::FTP does not directly support, to the remote
server and wait for a response.
.Sp
Returns most significant digit of the response code.
.Sp
\&\fB\s-1WARNING\s0\fR This call should only be used on commands that do not require
data connections. Misuse of this method can hang the connection.
.SH "THE dataconn CLASS"
.IX Header "THE dataconn CLASS"
Some of the methods defined in \f(CW\*(C`Net::FTP\*(C'\fR return an object which will
be derived from this class.The dataconn class itself is derived from
the \f(CW\*(C`IO::Socket::INET\*(C'\fR class, so any normal \s-1IO\s0 operations can be performed.
However the following methods are defined in the dataconn class and \s-1IO\s0 should
be performed using these.
.IP "read ( \s-1BUFFER\s0, \s-1SIZE\s0 [, \s-1TIMEOUT\s0 ] )" 4
.IX Item "read ( BUFFER, SIZE [, TIMEOUT ] )"
Read \f(CW\*(C`SIZE\*(C'\fR bytes of data from the server and place it into \f(CW\*(C`BUFFER\*(C'\fR, also
performing any <\s-1CRLF\s0> translation necessary. \f(CW\*(C`TIMEOUT\*(C'\fR is optional, if not
given, the timeout value from the command connection will be used.
.Sp
Returns the number of bytes read before any <\s-1CRLF\s0> translation.
.IP "write ( \s-1BUFFER\s0, \s-1SIZE\s0 [, \s-1TIMEOUT\s0 ] )" 4
.IX Item "write ( BUFFER, SIZE [, TIMEOUT ] )"
Write \f(CW\*(C`SIZE\*(C'\fR bytes of data from \f(CW\*(C`BUFFER\*(C'\fR to the server, also
performing any <\s-1CRLF\s0> translation necessary. \f(CW\*(C`TIMEOUT\*(C'\fR is optional, if not
given, the timeout value from the command connection will be used.
.Sp
Returns the number of bytes written before any <\s-1CRLF\s0> translation.
.IP "bytes_read ()" 4
.IX Item "bytes_read ()"
Returns the number of bytes read so far.
.IP "abort ()" 4
.IX Item "abort ()"
Abort the current data transfer.
.IP "close ()" 4
.IX Item "close ()"
Close the data connection and get a response from the \s-1FTP\s0 server. Returns
\&\fItrue\fR if the connection was closed successfully and the first digit of
the response from the server was a '2'.
.SH "UNIMPLEMENTED"
.IX Header "UNIMPLEMENTED"
The following \s-1RFC959\s0 commands have not been implemented:
.IP "\fB\s-1SMNT\s0\fR" 4
.IX Item "SMNT"
Mount a different file system structure without changing login or
accounting information.
.IP "\fB\s-1HELP\s0\fR" 4
.IX Item "HELP"
Ask the server for \*(L"helpful information\*(R" (that's what the \s-1RFC\s0 says) on
the commands it accepts.
.IP "\fB\s-1MODE\s0\fR" 4
.IX Item "MODE"
Specifies transfer mode (stream, block or compressed) for file to be
transferred.
.IP "\fB\s-1SYST\s0\fR" 4
.IX Item "SYST"
Request remote server system identification.
.IP "\fB\s-1STAT\s0\fR" 4
.IX Item "STAT"
Request remote server status.
.IP "\fB\s-1STRU\s0\fR" 4
.IX Item "STRU"
Specifies file structure for file to be transferred.
.IP "\fB\s-1REIN\s0\fR" 4
.IX Item "REIN"
Reinitialize the connection, flushing all I/O and account information.
.SH "REPORTING BUGS"
.IX Header "REPORTING BUGS"
When reporting bugs/problems please include as much information as possible.
It may be difficult for me to reproduce the problem as almost every setup
is different.
.PP
A small script which yields the problem will probably be of help. It would
also be useful if this script was run with the extra options \f(CW\*(C`Debug =\*(C'\fR 1>
passed to the constructor, and the output sent with the bug report. If you
cannot include a small script then please include a Debug trace from a
run of your program which does yield the problem.
.SH "AUTHOR"
.IX Header "AUTHOR"
Graham Barr <gbarr@pobox.com>
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Net::Netrc
Net::Cmd
.PP
\&\fIftp\fR\|(1), \fIftpd\fR\|(8), \s-1RFC\s0 959
http://www.cis.ohio\-state.edu/htbin/rfc/rfc959.html
.SH "USE EXAMPLES"
.IX Header "USE EXAMPLES"
For an example of the use of Net::FTP see
.IP "http://www.csh.rit.edu/~adam/Progs/" 4
.IX Item "http://www.csh.rit.edu/~adam/Progs/"
\&\f(CW\*(C`autoftp\*(C'\fR is a program that can retrieve, send, or list files via
the \s-1FTP\s0 protocol in a non-interactive manner.
.SH "CREDITS"
.IX Header "CREDITS"
Henry Gabryjelski <henryg@WPI.EDU> \- for the suggestion of creating directories
recursively.
.PP
Nathan Torkington <gnat@frii.com> \- for some input on the documentation.
.PP
Roderick Schertler <roderick@gate.net> \- for various inputs
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 1995\-2004 Graham Barr. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.