downmovies 发表于 2018-8-31 08:43:50

perl中Net::FTP帮助文档

  Determine if the server supports the specified feature. The return value is a list of lines the server responded with to describe the options that it supports for the given feature. If the feature is unsupported then the empty list is returned.
  

  
if ($ftp->feature( 'MDTM' )) {
  
# Do something
  
}
  

  
if (grep { /\bTLS\b/ } $ftp->feature('AUTH')) {
  
# Server supports TLS
  
}
  

  The following methods can return different results depending on how they are called. If the user explicitly calls either of the pasv or port methods then these methods will return a true or false value. If the user does not call either of these methods then the result will be a reference to a Net::FTP::dataconn based object.

nlst ( [ DIR ] )  Send an NLST command to the server, with an optional parameter.

list ( [ DIR ] )  Same as nlst but using the LIST command

retr ( FILE )  Begin the retrieval of a file called FILE from the remote server.

stor ( FILE )  Tell the server that you wish to store a file. FILE is the name of the new file that should be created.

stou ( FILE )  Same as stor but using the STOU command. The name of the unique file which was created on the server will be available via the unique_name method after the data connection has been closed.

appe ( FILE )  Tell the server that we want to append some data to the end of a file called FILE. If this file does not exist then create it.

  If for some reason you want to have complete control over the data connection, this includes generating it and calling the response method when required, then the user can use these methods to do so.
  However calling these methods only affects the use of the methods above that can return a data connection. They have no effect on methods get, put, put_unique and those that do not require data connections.

port ( [ PORT ] )  Send a PORT command to the server. If PORT 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.

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 port method.

  The following methods can be used to transfer files between two remote servers, providing that these two servers can connect directly to each other.

pasv_xfer ( SRC_FILE, DEST_SERVER [, DEST_FILE ] )  This method will do a file transfer between two remote ftp servers. If DEST_FILE is omitted then the leaf name of SRC_FILE will be used.

pasv_xfer_unique ( SRC_FILE, DEST_SERVER [, DEST_FILE ] )  Like pasv_xfer but the file is stored on the remote server using the STOU command.

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 Net::FTP object for the non-passive server passed as an argument.

abort ()  Abort the current data transfer.

quit ()  Send the QUIT command to the remote FTP server and close the socket connection.



页: [1]
查看完整版本: perl中Net::FTP帮助文档