|
楼主 |
发表于 2005-10-10 05:33:15
|
显示全部楼层
<a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" >RFC</A><U>959</U> October 1985<BR>File Transfer Protocol<BR><BR>5.3.2. <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> COMMAND ARGUMENTS<BR><BR>The syntax of the above argument fields (using BNF notation<BR>where applicable) is:<BR><BR><username> ::= <string><BR><password> ::= <string><BR><account-information> ::= <string><BR><string> ::= <char> | <char><string><BR><char> ::= any of the 128 ASCII characters except <CR> and<BR><LF><BR><marker> ::= <pr-string><BR><pr-string> ::= <pr-char> | <pr-char><pr-string><BR><pr-char> ::= printable characters, any<BR>ASCII code 33 through 126<BR><byte-size> ::= <number><BR><host-port> ::= <host-number>,<port-number><BR><host-number> ::= <number>,<number>,<number>,<number><BR><port-number> ::= <number>,<number><BR><number> ::= any decimal integer 1 through 255<BR><form-code> ::= N | T | C<BR><type-code> ::= A [<sp> <form-code>]<BR>| E [<sp> <form-code>]<BR>| I<BR>| L <sp> <byte-size><BR><structure-code> ::= F | R | P<BR><mode-code> ::= S | B | C<BR><pathname> ::= <string><BR><decimal-integer> ::= any decimal integer<BR><BR><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" >RFC</A>959</U> October 1985<BR>File Transfer Protocol<BR><BR>5.4. SEQUENCING OF COMMANDS AND REPLIES<BR><BR>The communication between the user and server is intended to be an<BR>alternating dialogue. As such, the user issues an <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> command and<BR>the server responds with a prompt primary reply. The user should<BR>wait for this initial primary success or failure response before<BR>sending further commands.<BR><BR>Certain commands require a second reply for which the user should<BR>also wait. These replies may, for example, report on the progress<BR>or completion of file transfer or the closing of the data<BR>connection. They are secondary replies to file transfer commands.<BR><BR>One important group of informational replies is the connection<BR>greetings. Under normal circumstances, a server will send a 220<BR>reply, "awaiting input", when the connection is completed. The<BR>user should wait for this greeting message before sending any<BR>commands. If the server is unable to accept input right away, a<BR>120 "expected delay" reply should be sent immediately and a 220<BR>reply when ready. The user will then know not to hang up if there<BR>is a delay.<BR><BR>Spontaneous Replies<BR><BR>Sometimes "the system" spontaneously has a message to be sent<BR>to a user (usually all users). For example, "System going down<BR>in 15 minutes". There is no provision in <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> for such<BR>spontaneous information to be sent from the server to the user.<BR>It is recommended that such information be queued in the<BR>server-PI and delivered to the user-PI in the next reply<BR>(possibly making it a multi-line reply).<BR><BR>The table below lists alternative success and failure replies for<BR>each command. These must be strictly adhered to; a server may<BR>substitute text in the replies, but the meaning and action implied<BR>by the code numbers and by the specific command reply sequence<BR>cannot be altered.<BR><BR>Command-Reply Sequences<BR><BR>In this section, the command-reply sequence is presented. Each<BR>command is listed with its possible replies; command groups are<BR>listed together. Preliminary replies are listed first (with<BR>their succeeding replies indented and under them), then<BR>positive and negative completion, and finally intermediary<BR><BR><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" >RFC</A>959</U> October 1985<BR>File Transfer Protocol<BR><BR>replies with the remaining commands from the sequence<BR>following. This listing forms the basis for the state<BR>diagrams, which will be presented separately.<BR><BR>Connection Establishment<BR>120<BR>220<BR>220<BR>421<BR>Login<BR>USER<BR>230<BR>530<BR>500, 501, 421<BR>331, 332<BR>ASS<BR>230<BR>202<BR>530<BR>500, 501, 503, 421<BR>332<BR>ACCT<BR>230<BR>202<BR>530<BR>500, 501, 503, 421<BR>CWD<BR>250<BR>500, 501, 502, 421, 530, 550<BR>CDUP<BR>200<BR>500, 501, 502, 421, 530, 550<BR>SMNT<BR>202, 250<BR>500, 501, 502, 421, 530, 550<BR>Logout<BR>REIN<BR>120<BR>220<BR>220<BR>421<BR>500, 502<BR>QUIT<BR>221<BR>500<BR><BR><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" >RFC</A>959</U> October 1985<BR>File Transfer Protocol<BR><BR>Transfer parameters<BR>ORT<BR>200<BR>500, 501, 421, 530<BR>ASV<BR>227<BR>500, 501, 502, 421, 530<BR>MODE<BR>200<BR>500, 501, 504, 421, 530<BR>TYPE<BR>200<BR>500, 501, 504, 421, 530<BR>STRU<BR>200<BR>500, 501, 504, 421, 530<BR>File action commands<BR>ALLO<BR>200<BR>202<BR>500, 501, 504, 421, 530<BR>REST<BR>500, 501, 502, 421, 530<BR>350<BR>STOR<BR>125, 150<BR>(110)<BR>226, 250<BR>425, 426, 451, 551, 552<BR>532, 450, 452, 553<BR>500, 501, 421, 530<BR>STOU<BR>125, 150<BR>(110)<BR>226, 250<BR>425, 426, 451, 551, 552<BR>532, 450, 452, 553<BR>500, 501, 421, 530<BR>RETR<BR>125, 150<BR>(110)<BR>226, 250<BR>425, 426, 451<BR>450, 550<BR>500, 501, 421, 530 |
|