﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-城市中的一条鱼-随笔分类-其他技术话题</title><link>http://www.blogjava.net/narry/category/22357.html</link><description>雪化了，就是春天</description><language>zh-cn</language><lastBuildDate>Sun, 03 Oct 2010 06:57:06 GMT</lastBuildDate><pubDate>Sun, 03 Oct 2010 06:57:06 GMT</pubDate><ttl>60</ttl><item><title>ftp通信时的指令</title><link>http://www.blogjava.net/narry/archive/2007/05/11/116853.html</link><dc:creator>narry</dc:creator><author>narry</author><pubDate>Fri, 11 May 2007 11:27:00 GMT</pubDate><guid>http://www.blogjava.net/narry/archive/2007/05/11/116853.html</guid><wfw:comment>http://www.blogjava.net/narry/comments/116853.html</wfw:comment><comments>http://www.blogjava.net/narry/archive/2007/05/11/116853.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/narry/comments/commentRss/116853.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/narry/services/trackbacks/116853.html</trackback:ping><description><![CDATA[今天在一个国外网站看到了ftp通信时的指令，将它贴在这里：<br>
<h2>FTP Commands</h2>
<p>This document describes all the FTP commands implemented.</p>
<h3><a name="FTPCommands-ABOR"></a>ABOR</h3>
<p>Aborts the previous FTP service command and any associated transfer of data.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            226 ABOR command successful.</p>
<h3><a name="FTPCommands-ACCT"></a>ACCT</h3>
<p>Provides the user's account. Not used by FtpServer.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            202 Command ACCT not implemented.</p>
<h3><a name="FTPCommands-APPE"></a>APPE</h3>
<p>Appends data to the end of a file on the remote host. If the file
does not already exist, it is created. This command must be preceded by
a PORT or PASV command.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 Not a plain file.<br>
550 Permission denied.<br>
150 Opening data connection.<br>
425 Cannot open data connection.<br>
426 Data connection error.<br>
551 Error on output file.<br>
226 Transfer complete.</p>
<h3><a name="FTPCommands-AUTH"></a>AUTH</h3>
<p>Establishes SSL encrypted session. Only SSL type is supported.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
431 Service is unavailable.<br>
234 AUTH command okay; starting SSL connection.</p>
<h3><a name="FTPCommands-CDUP"></a>CDUP</h3>
<p>Change to parent directory.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            250 Command okay.<br>
550 No such directory.</p>
<h3><a name="FTPCommands-CWD"></a>CWD</h3>
<p>Changes the working directory. If directory name is not specified, root directory (/) is assumed.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            250 Command okay.<br>
550 No such directory.</p>
<h3><a name="FTPCommands-DELE"></a>DELE</h3>
<p>Deletes the file specified by the provided path.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            250 Command okay.<br>
450 No permission to delete.<br>
450 Can't delete file.<br>
550 Not a valid file.<br>
501 Syntax error in parameters or arguments.</p>
<h3><a name="FTPCommands-EPRT"></a>EPRT</h3>
<p>The EPRT command allows for the specification of an extended address
for the data connection. The extended address MUST consist of the
network protocol as well as the network and transport addresses. The
format of EPRT is EPRT
|&lt;net-prt&gt;|&lt;net-addr&gt;|&lt;tcp-port&gt;|</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
510 EPRT is disabled.<br>
510 Syntax error.<br>
553 Host unknown.<br>
510 EPRT IP is not same as client IP.<br>
552 Not a valid port number.<br>
200 EPRT command okay.</p>
<h3><a name="FTPCommands-EPSV"></a>EPSV</h3>
<p>The EPSV command requests that a server listen on a data port and wait for a connection.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            425 Cannot open passive connection.<br>
229 Entering passive mode (&lt;message&gt;).</p>
<h3><a name="FTPCommands-FEAT"></a>FEAT</h3>
<p>Displays the feature list.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            221 List of all the extensions supported.</p>
<h3><a name="FTPCommands-HELP"></a>HELP</h3>
<p>Displays the help information.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            214 Help information.</p>
<h3><a name="FTPCommands-LANG"></a>LANG</h3>
<p>A new command "LANG" is added to the FTP command set to allow
server-FTP process to determine in which language to present server
greetings and the textual part of command responses.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            502 Not yet implemented.</p>
<h3><a name="FTPCommands-LIST"></a>LIST</h3>
<p>This command causes a list to be sent from the server to the passive
DTP. If the pathname specifies a directory or other group of files, the
server should transfer a list of files in the specified directory. If
the pathname specifies a file then the server should send current
information on the file. A null argument implies the user's current
working or default directory. The data transfer is over the data
connection. This command must be preceded by a PORT or PASV command.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            150 Opening data connection.<br>
425 Cannot open data connection.<br>
426 Data connection error.<br>
551 File listing failed.<br>
501 Syntax error.<br>
226 Closing data connection.</p>
<h3><a name="FTPCommands-MDTM"></a>MDTM</h3>
<p>Returns the date and time of when a file was modified.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 File unavailable.<br>
213 &lt;timestamp&gt;</p>
<h3><a name="FTPCommands-MKD"></a>MKD</h3>
<p>This command causes the directory specified in the pathname to be
created as a directory (if the pathname is absolute) or as a
subdirectory of the current working directory (if the pathname is
relative).</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 Not a valid file.<br>
550 Already exists.<br>
550 No permission.<br>
250 Directory created.<br>
550 Cannot create directory.</p>
<h3><a name="FTPCommands-MLSD"></a>MLSD</h3>
<p>Causes a list to be sent from the server to the passive DTP</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            150 File status okay; about to open data connection.<br>
226 Closing data connection.<br>
425 Can't open data connection.<br>
426 Data connection error.<br>
501 Syntax error in parameters or arguments.<br>
551 File listing failed.</p>
<h3><a name="FTPCommands-MODE"></a>MODE</h3>
<p>Set data transfer mode. The valid values are S and Z.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
504 Not implemented for this command.<br>
200 Command okay.</p>
<h3><a name="FTPCommands-NLST"></a>NLST</h3>
<p>This command causes a directory listing to be sent from server to
user site. The pathname should specify a directory or other
system-specific file group descriptor; a null argument implies the
current directory. The server will return a stream of names of files
and no other information.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            150 Opening data connection.<br>
425 Cannot open data connection.<br>
426 Data connection error.<br>
551 File listing failed.<br>
501 Syntax error.<br>
226 Closing data connection.</p>
<h3><a name="FTPCommands-NOOP"></a>NOOP</h3>
<p>No operation.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            200 Command okay.</p>
<h3><a name="FTPCommands-NOOP"></a>NOOP</h3>
<p>Cause the server use optional features for the command specified.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            500 Execution failed.<br>
501 Syntax error in parameters or arguments.<br>
502 Command OPTS not implemented for ...<br>
Additional return codes available for different OPTS commands.</p>
<h3><a name="FTPCommands-PASS"></a>PASS</h3>
<p>The argument field is a Telnet string specifying the user's
password. This command must be immediately preceded by the USER command.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
503 Login with USER first.<br>
202 Already logged-in.<br>
421 Maximum anonymous login limit has been reached.<br>
421 Maximum login limit has been reached.<br>
530 Authentication failed.<br>
230 User logged in, proceed.</p>
<h3><a name="FTPCommands-PASV"></a>PASV</h3>
<p>This command requests the server-DTP to listen on a data port (which
is not its default data port) and to wait for a connection rather than
initiate one upon receipt of a transfer command. The response to this
command includes the host and port address this server is listening on.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            425 Cannot open passive connection.<br>
227 Entering passive mode (&lt;h1,h2,h3,h4,p1,p2&gt;)</p>
<h3><a name="FTPCommands-PBSZ"></a>PBSZ</h3>
<p>protection buffer size.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            200 Command okay.</p>
<h3><a name="FTPCommands-PORT"></a>PORT</h3>
<p>The argument is a HOST-PORT specification for the data port to be
used in data connection. There are defaults for both the user and
server data ports, and under normal circumstances this command and its
reply are not needed. If this command is used, the argument is the
concatenation of a 32-bit internet host address and a 16-bit TCP port
address. This address information is broken into 8-bit fields and the
value of each field is transmitted as a decimal number (in character
string representation). The fields are separated by commas. A port
command would be:</p>
<p> PORT h1,h2,h3,h4,p1,p2</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
510 Syntax error in parameters.<br>
510 Port is disabled.<br>
553 Host unknown.<br>
510 PORT IP mismatch.<br>
552 Invalid port number.<br>
200 Command PORT okay.</p>
<h3><a name="FTPCommands-PROT"></a>PROT</h3>
<p>Data channel protection level. The supported level values are C, P.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
431 Security is disabled.<br>
504 Server does not understand the specified protection level.<br>
200 Command PROT okay.</p>
<h3><a name="FTPCommands-PWD"></a>PWD</h3>
<p>This command causes the name of the current working directory to be returned in the reply.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            257 "&lt;current directory&gt;"</p>
<h3><a name="FTPCommands-QUIT"></a>QUIT</h3>
<p>Closes connection.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            200 Goodbye.</p>
<h3><a name="FTPCommands-REIN"></a>REIN</h3>
<p>Flushes a user, without affecting transfers in progress</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            220 Service ready for new user.</p>
<h3><a name="FTPCommands-REST"></a>REST</h3>
<p>The argument field represents the server marker at which file
transfer is to be restarted. This command does not cause file transfer
but skips over the file to the specified data checkpoint. This command
shall be immediately followed by the appropriate FTP service command
which shall cause file transfer to resume.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
501 Not a valid number.<br>
501 Marker cannot be negetive.<br>
350 Restarting at &lt;position&gt;. Send STORE or RETRIEVE to initiate transfer.</p>
<h3><a name="FTPCommands-RETR"></a>RETR</h3>
<p>This command causes the server-DTP to transfer a copy of the file,
specified in the pathname, to the server- or user-DTP at the other end
of the data connection. The status and contents of the file at the
server site shall be unaffected.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 No such file or directory.<br>
550 Not a plain file.<br>
550 Permission denied.<br>
150 Opening data connection.<br>
425 Cannot open the data connection.<br>
426 Data connection error.<br>
551 Error on input file.<br>
226 Transfer complete.</p>
<h3><a name="FTPCommands-RMD"></a>RMD</h3>
<p>This command causes the directory specified in the pathname to be
removed as a directory (if the pathname is absolute) or as a
subdirectory of the current working directory (if the pathname is
relative).</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 No permission.<br>
550 Not a valid directory.<br>
250 Directory removed.<br>
550 Cannot remove directory.</p>
<h3><a name="FTPCommands-RNFR"></a>RNFR</h3>
<p>This command specifies the old pathname of the file which is to be
renamed. This command must be immediately followed by a RNTO command
specifying the new file pathname.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 File unavailable.<br>
350 Requested file action pending further information.</p>
<h3><a name="FTPCommands-RNTO"></a>RNTO</h3>
<p>This command specifies the new pathname of the file specified in the
immediately preceding RNFR command. Together the two commands cause a
file to be renamed.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
503 Cannot find the file which has to be renamed.<br>
553 Not a valid file name.<br>
553 No permission.<br>
250 Requested file action okay, file renamed.<br>
553 Cannot rename file.</p>
<h3><a name="FTPCommands-SITE"></a>SITE</h3>
<p>Handle Apache FTP Server specific custom commands. Please see the SITE commands page.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            200 Command SITE okay.<br>
502 Command SITE not implemented for this argument.<br>
500 Execution failed.<br>
530 Access denied.</p>
<h3><a name="FTPCommands-SIZE"></a>SIZE</h3>
<p>Returns the size of the file in bytes.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 No such file or directory.<br>
550 Not a plain file.<br>
213 &lt;size&gt;</p>
<h3><a name="FTPCommands-STAT"></a>STAT</h3>
<p>This command shall cause a status response to be sent over the control connection in the form of a reply.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            211 Statistics information.</p>
<h3><a name="FTPCommands-STOR"></a>STOR</h3>
<p>This command causes the server-DTP to accept the data transferred
via the data connection and to store the data as a file at the server
site. If the file specified in the pathname exists at the server site,
then its contents shall be replaced by the data being transferred. A
new file is created at the server site if the file specified in the
pathname does not already exist.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
550 Invalid path.<br>
550 Permission denied.<br>
150 Opening data connection.<br>
425 Cannot open the data connection.<br>
426 Data connection error.<br>
551 Error on output file.<br>
226 Transfer complete.</p>
<h3><a name="FTPCommands-STOU"></a>STOU</h3>
<p>This command behaves like STOR except that the resultant file is to
be created in the current directory under a name unique to that
directory. The 250 Transfer Started response must include the name
generated.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            550 Unique file name error.<br>
550 Permission denied.<br>
150 Opening data connection.<br>
425 Cannot open the data connection.<br>
250 &lt;file&gt; Transfer started.<br>
426 Data connection error.<br>
551 Error on output file.<br>
226 Transfer complete.</p>
<h3><a name="FTPCommands-STRU"></a>STRU</h3>
<p>The argument is a single Telnet character code specifying file structure. The allowed argument is F.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
504 Command not implemented.<br>
200 Command okay.</p>
<h3><a name="FTPCommands-SYST"></a>SYST</h3>
<p>This command is used to find out the type of operating system at the server.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            215 UNIX Type: Apache FTP Server</p>
<h3><a name="FTPCommands-TYPE"></a>TYPE</h3>
<p>The argument specifies the representation type. The allowed types are A and I.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
504 Command not implemented.<br>
200 Command okay.</p>
<h3><a name="FTPCommands-USER"></a>USER</h3>
<p>The argument field is a Telnet string identifying the user. The user
identification is that which is required by the server for access to
its file system. This command will normally be the first command
transmitted by the user after the control connections are made.</p>
<h4><a name="FTPCommands-ServerReplies"></a>Server Replies</h4>
<p>            501 Syntax error.<br>
230 Already logged-in.<br>
530 Invalid user name.<br>
530 Anonymous connection is not allowed.<br>
421 Maximum anonymous login limit has been reached.<br>
421 Maximum login limit has been reached.<br>
331 Guest login okay, send your complete e-mail address as password.<br>
331 User name okay, need password.</p>
<br><br><img src ="http://www.blogjava.net/narry/aggbug/116853.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/narry/" target="_blank">narry</a> 2007-05-11 19:27 <a href="http://www.blogjava.net/narry/archive/2007/05/11/116853.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>