perl中Net::FTP協助文檔

來源:互聯網
上載者:User

網上搜了一下,發現了這個文檔,其他基本就不用再看了:

http://search.cpan.org/~gbarr/libnet-1.22/Net/FTP.pm

為方便查閱,截取部分如下:

use Net::FTP;             $ftp = Net::FTP->new("some.host.name", Debug => 0)       or die "Cannot connect to some.host.name: $@";             $ftp->login("anonymous",'-anonymous@')       or die "Cannot login ", $ftp->message;             $ftp->cwd("/pub")       or die "Cannot change working directory ", $ftp->message;             $ftp->get("that.file")       or die "get failed ", $ftp->message;             $ftp->quit;

login ([LOGIN [,PASSWORD [, ACCOUNT] ] ])

Log into the remote FTP server with the given login information. If no arguments are given then the Net::FTP uses the Net::Netrc package to lookup the login information for the connected host. If no information is found then a login of anonymous is used. If no password is given and the login is anonymous then anonymous@ will be used for password.

If the connection is via a firewall then the authorize method will be called with no arguments.

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 authorize uses Net::Netrc to do a lookup.

site (ARGS)

Send a SITE command to the remote server and wait for a response.

Returns most significant digit of the response code.

ascii

Transfer file in ASCII. CRLF translation will be done if required

binary

Transfer file in binary mode. No transformation will be done.

Hint: 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.

rename ( OLDNAME, NEWNAME )

Rename a file on the remote FTP server from OLDNAME to NEWNAME. This is done by sending the RNFR and RNTO commands.

delete ( FILENAME )

Send a request to the server to delete FILENAME.

cwd ( [ DIR ] )

Attempt to change directory to the directory given in $dir. If $dir is "..", the FTP CDUP 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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.