X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FNet%2FFTP.pm;h=d2780d31f6b1ba7373b7d0d1bec34a7329464d59;hb=c798bd2165d7b5d59c62ab6330f7cf77ff8b09dd;hp=531ff405bb5ca460065f6f397f641c805b1124b4;hpb=302c2e6b3178d72ea1114a76af5852e6680bacc8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm index 531ff40..d2780d3 100644 --- a/lib/Net/FTP.pm +++ b/lib/Net/FTP.pm @@ -22,7 +22,7 @@ use Net::Config; use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC); # use AutoLoader qw(AUTOLOAD); -$VERSION = "2.61"; # $Id: //depot/libnet/Net/FTP.pm#61 $ +$VERSION = "2.62"; # $Id: //depot/libnet/Net/FTP.pm#64 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); # Someday I will "use constant", when I am not bothered to much about @@ -142,11 +142,7 @@ sub quit $ftp->close; } -sub DESTROY -{ - my $ftp = shift; - defined(fileno($ftp)) && $ftp->quit -} +sub DESTROY {} sub ascii { shift->type('A',@_); } sub binary { shift->type('I',@_); } @@ -310,7 +306,7 @@ sub login { ($ruser,$pass,$acct) = $rc->lpa() if ($rc); - $pass = "-" . (eval { (getpwuid($>))[0] } || $ENV{NAME} ) . '@' + $pass = '-anonymous@' if (!defined $pass && (!defined($ruser) || $ruser =~ /^anonymous/o)); } @@ -1200,7 +1196,7 @@ Net::FTP - FTP Client class use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 0); - $ftp->login("anonymous",'me@here.there'); + $ftp->login("anonymous",'-anonymous@'); $ftp->cwd("/pub"); $ftp->get("that.file"); $ftp->quit; @@ -1247,17 +1243,17 @@ this if you really know what you're doing). =item new (HOST [,OPTIONS]) This is the constructor for a new Net::FTP object. C is the -name of the remote host to which a FTP connection is required. +name of the remote host to which an FTP connection is required. C are passed in a hash like fashion, using key and value pairs. Possible options are: -B - The name of a machine which acts as a FTP firewall. This can be +B - The name of a machine which acts as an FTP firewall. This can be overridden by an environment variable C. If specified, and the given host cannot be directly connected to, then the connection is made to the firewall machine and the string C<@hostname> is appended to the login identifier. This kind of setup is also refered to -as a ftp proxy. +as an ftp proxy. B - The type of firewall running on the machine indicated by B. This can be overridden by an environment variable @@ -1394,7 +1390,7 @@ a scalar context, returns a reference to a list. =item get ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] ) Get C from the server and store locally. C may be -a filename or a filehandle. If not specified the the file will be stored in +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. If C is given then the first C bytes of the file will @@ -1476,7 +1472,7 @@ reference to a C based object. =item nlst ( [ DIR ] ) -Send a C command to the server, with an optional parameter. +Send an C command to the server, with an optional parameter. =item list ( [ DIR ] ) @@ -1517,7 +1513,7 @@ C and those that do not require data connections. =item port ( [ PORT ] ) Send a C command to the server. If C is specified then it is sent -to the server. If not the a listen socket is created and the correct information +to the server. If not, then a listen socket is created and the correct information sent to the server. =item pasv () @@ -1593,7 +1589,7 @@ be performed using these. Read C bytes of data from the server and place it into C, also performing any translation necessary. C is optional, if not -given the the timeout value from the command connection will be used. +given, the timeout value from the command connection will be used. Returns the number of bytes read before any translation. @@ -1601,7 +1597,7 @@ Returns the number of bytes read before any translation. Write C bytes of data from C to the server, also performing any translation necessary. C is optional, if not -given the the timeout value from the command connection will be used. +given, the timeout value from the command connection will be used. Returns the number of bytes written before any translation. @@ -1718,6 +1714,6 @@ under the same terms as Perl itself. =for html
-I<$Id: //depot/libnet/Net/FTP.pm#61 $> +I<$Id: //depot/libnet/Net/FTP.pm#64 $> =cut