数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 4099|回复: 2

rfcp30~p40

[复制链接]
发表于 2005-10-8 23:39:48 | 显示全部楼层 |阅读模式
< ><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" >RFC</A>959</U> October 1985<BR>File Transfer Protocol<BR><BR>the command. This second argument is optional, but when<BR>present should be separated from the first by the three<BR>Telnet characters &lt;SP&gt; R &lt;SP&gt;. This command shall be<BR>followed by a STORe or APPEnd command. The ALLO command<BR>should be treated as a NOOP (no operation) by those servers<BR>which do not require that the maximum size of the file be<BR>declared beforehand, and those servers interested in only<BR>the maximum record or page size should accept a dummy value<BR>in the first argument and ignore it.<BR><BR>RESTART (REST)<BR><BR>The argument field represents the server marker at which<BR>file transfer is to be restarted. This command does not<BR>cause file transfer but skips over the file to the specified<BR>data checkpoint. This command shall be immediately followed<BR>by the appropriate <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> service command which shall cause<BR>file transfer to resume.<BR><BR>RENAME FROM (RNFR)<BR><BR>This command specifies the old pathname of the file which is<BR>to be renamed. This command must be immediately followed by<BR>a "rename to" command specifying the new file pathname.<BR><BR>RENAME TO (RNTO)<BR><BR>This command specifies the new pathname of the file<BR>specified in the immediately preceding "rename from"<BR>command. Together the two commands cause a file to be<BR>renamed.<BR><BR>ABORT (ABOR)<BR><BR>This command tells the server to abort the previous <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A><BR>service command and any associated transfer of data. The<BR>abort command may require "special action", as discussed in<BR>the Section on <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> Commands, to force recognition by the<BR>server. No action is to be taken if the previous command<BR>has been completed (including data transfer). The control<BR>connection is not to be closed by the server, but the data<BR>connection must be closed.<BR><BR>There are two cases for the server upon receipt of this<BR>command: (1) the <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> service command was already completed,<BR>or (2) the <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> service command is still in progress.<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>In the first case, the server closes the data connection<BR>(if it is open) and responds with a 226 reply, indicating<BR>that the abort command was successfully processed.<BR><BR>In the second case, the server aborts the <a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> service in<BR>progress and closes the data connection, returning a 426<BR>reply to indicate that the service request terminated<BR>abnormally. The server then sends a 226 reply,<BR>indicating that the abort command was successfully<BR>processed.<BR><BR>DELETE (DELE)<BR><BR>This command causes the file specified in the pathname to be<BR>deleted at the server site. If an extra level of protection<BR>is desired (such as the query, "Do you really wish to<BR>delete?"), it should be provided by the user-<a href="http://www.cnpaf.net/class/ftp/" target="_blank" >FTP</A> process.<BR><BR>REMOVE DIRECTORY (RMD)<BR><BR>This command causes the directory specified in the pathname<BR>to be removed as a directory (if the pathname is absolute)<BR>or as a subdirectory of the current working directory (if<BR>the pathname is relative). See Appendix II.<BR><BR>MAKE DIRECTORY (MKD)<BR><BR>This command causes the directory specified in the pathname<BR>to be created as a directory (if the pathname is absolute)<BR>or as a subdirectory of the current working directory (if<BR>the pathname is relative). See Appendix II.<BR><BR>RINT WORKING DIRECTORY (PWD)<BR><BR>This command causes the name of the current working<BR>directory to be returned in the reply. See Appendix II.<BR><BR></P>
 楼主| 发表于 2005-10-8 23:40:41 | 显示全部楼层
<FONT size=2>LIST (LIST)<BR><BR>This command causes a list to be sent from the server to the<BR>passive DTP. If the pathname specifies a directory or other<BR>group of files, the server should transfer a list of files<BR>in the specified directory. If the pathname specifies a<BR>file then the server should send current information on the<BR>file. A null argument implies the user's current working or<BR>default directory. The data transfer is over the data<BR>connection in type ASCII or type EBCDIC. (The user must<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR>ensure that the TYPE is appropriately ASCII or EBCDIC).<BR>Since the information on a file may vary widely from system<BR>to system, this information may be hard to use automatically<BR>in a program, but may be quite useful to a human user.<BR><BR>NAME LIST (NLST)<BR><BR>This command causes a directory listing to be sent from<BR>server to user site. The pathname should specify a<BR>directory or other system-specific file group descriptor; a<BR>null argument implies the current directory. The server<BR>will return a stream of names of files and no other<BR>information. The data will be transferred in ASCII or<BR>EBCDIC type over the data connection as valid pathname<BR>strings separated by &lt;CRLF&gt; or &lt;NL&gt;. (Again the user must<BR>ensure that the TYPE is correct.) This command is intended<BR>to return information that can be used by a program to<BR>further process the files automatically. For example, in<BR>the implementation of a "multiple get" function.<BR><BR>SITE PARAMETERS (SITE)<BR><BR>This command is used by the server to provide services<BR>specific to his system that are essential to file transfer<BR>but not sufficiently universal to be included as commands in<BR>the protocol. The nature of these services and the<BR>specification of their syntax can be stated in a reply to<BR>the HELP SITE command.<BR><BR>SYSTEM (SYST)<BR><BR>This command is used to find out the type of operating<BR>system at the server. The reply shall have as its first<BR>word one of the system names listed in the current version<BR>of the Assigned Numbers document [4].<BR><BR>STATUS (STAT)<BR><BR>This command shall cause a status response to be sent over<BR>the control connection in the form of a reply. The command<BR>may be sent during a file transfer (along with the Telnet IP<BR>and Synch signals--see the Section on </FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> Commands) in which<BR>case the server will respond with the status of the<BR>operation in progress, or it may be sent between file<BR>transfers. In the latter case, the command may have an<BR>argument field. If the argument is a pathname, the command<BR>is analogous to the "list" command except that data shall be<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR>transferred over the control connection. If a partial<BR>pathname is given, the server may respond with a list of<BR>file names or attributes associated with that specification.<BR>If no argument is given, the server should return general<BR>status information about the server </FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> process. This<BR>should include current values of all transfer parameters and<BR>the status of connections.<BR><BR>HELP (HELP)<BR><BR>This command shall cause the server to send helpful<BR>information regarding its implementation status over the<BR>control connection to the user. The command may take an<BR>argument (e.g., any command name) and return more specific<BR>information as a response. The reply is type 211 or 214.<BR>It is suggested that HELP be allowed before entering a USER<BR>command. The server may use this reply to specify<BR>site-dependent parameters, e.g., in response to HELP SITE.<BR><BR>NOOP (NOOP)<BR><BR>This command does not affect any parameters or previously<BR>entered commands. It specifies no action other than that the<BR>server send an OK reply.<BR><BR>The File Transfer Protocol follows the specifications of the Telnet<BR>protocol for all communications over the control connection. Since<BR>the language used for Telnet communication may be a negotiated<BR>option, all references in the next two sections will be to the<BR>"Telnet language" and the corresponding "Telnet end-of-line code".<BR>Currently, one may take these to mean NVT-ASCII and &lt;CRLF&gt;. No other<BR>specifications of the Telnet protocol will be cited.<BR><BR></FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> commands are "Telnet strings" terminated by the "Telnet end of<BR>line code". The command codes themselves are alphabetic characters<BR>terminated by the character &lt;SP&gt; (Space) if parameters follow and<BR>Telnet-EOL otherwise. The command codes and the semantics of<BR>commands are described in this section; the detailed syntax of<BR>commands is specified in the Section on Commands, the reply sequences<BR>are discussed in the Section on Sequencing of Commands and Replies,<BR>and scenarios illustrating the use of commands are provided in the<BR>Section on Typical </FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> Scenarios.<BR><BR></FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> commands may be partitioned as those specifying access-control<BR>identifiers, data transfer parameters, or </FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> service requests.<BR>Certain commands (such as ABOR, STAT, QUIT) may be sent over the<BR>control connection while a data transfer is in progress. Some<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR>servers may not be able to monitor the control and data connections<BR>simultaneously, in which case some special action will be necessary<BR>to get the server's attention. The following ordered format is<BR>tentatively recommended:<BR><BR>1. User system inserts the Telnet "Interrupt Process" (IP) signal<BR>in the Telnet stream.<BR><BR>2. User system sends the Telnet "Synch" signal.<BR><BR>3. User system inserts the command (e.g., ABOR) in the Telnet<BR>stream.<BR><BR>4. Server PI, after receiving "IP", scans the Telnet stream for<BR>EXACTLY ONE </FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> command.<BR><BR>(For other servers this may not be necessary but the actions listed<BR>above should have no unusual effect.)<BR><BR>4.2. </FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> REPLIES<BR><BR>Replies to File Transfer Protocol commands are devised to ensure<BR>the synchronization of requests and actions in the process of file<BR>transfer, and to guarantee that the user process always knows the<BR>state of the Server. Every command must generate at least one<BR>reply, although there may be more than one; in the latter case,<BR>the multiple replies must be easily distinguished. In addition,<BR>some commands occur in sequential groups, such as USER, PASS and<BR>ACCT, or RNFR and RNTO. The replies show the existence of an<BR>intermediate state if all preceding commands have been successful.<BR>A failure at any point in the sequence necessitates the repetition<BR>of the entire sequence from the beginning.<BR><BR>The details of the command-reply sequence are made explicit in<BR>a set of state diagrams below.<BR><BR>An </FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> reply consists of a three digit number (transmitted as<BR>three alphanumeric characters) followed by some text. The number<BR>is intended for use by automata to determine what state to enter<BR>next; the text is intended for the human user. It is intended<BR>that the three digits contain enough encoded information that the<BR>user-process (the User-PI) will not need to examine the text and<BR>may either discard it or pass it on to the user, as appropriate.<BR>In particular, the text may be server-dependent, so there are<BR>likely to be varying texts for each reply code.<BR><BR>A reply is defined to contain the 3-digit code, followed by Space<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR>&lt;SP&gt;, followed by one line of text (where some maximum line length<BR>has been specified), and terminated by the Telnet end-of-line<BR>code. There will be cases however, where the text is longer than<BR>a single line. In these cases the complete text must be bracketed<BR>so the User-process knows when it may stop reading the reply (i.e.<BR>stop processing input on the control connection) and go do other<BR>things. This requires a special format on the first line to<BR>indicate that more than one line is coming, and another on the<BR>last line to designate it as the last. At least one of these must<BR>contain the appropriate reply code to indicate the state of the<BR>transaction. To satisfy all factions, it was decided that both<BR>the first and last line codes should be the same.<BR><BR>Thus the format for multi-line replies is that the first line<BR>will begin with the exact required reply code, followed<BR>immediately by a Hyphen, "-" (also known as Minus), followed by<BR>text. The last line will begin with the same code, followed<BR>immediately by Space &lt;SP&gt;, optionally some text, and the Telnet<BR>end-of-line code.<BR><BR>For example:<BR>123-First line<BR>Second line<BR><st1:chmetcnv w:st="on" UnitName="a" SourceValue="234" HasSpace="True" Negative="False" NumberType="1" TCSC="0">234 A</st1:chmetcnv> line beginning with numbers<BR>123 The last line<BR><BR>The user-process then simply needs to search for the second<BR>occurrence of the same reply code, followed by &lt;SP&gt; (Space), at<BR>the beginning of a line, and ignore all intermediary lines. If<BR>an intermediary line begins with a 3-digit number, the Server<BR>must pad the front to avoid confusion.<BR><BR>This scheme allows standard system routines to be used for<BR>reply information (such as for the STAT reply), with<BR>"artificial" first and last lines tacked on. In rare cases<BR>where these routines are able to generate three digits and a<BR>Space at the beginning of any line, the beginning of each<BR>text line should be offset by some neutral text, like Space.<BR><BR>This scheme assumes that multi-line replies may not be nested.<BR><BR>The three digits of the reply each have a special significance.<BR>This is intended to allow a range of very simple to very<BR>sophisticated responses by the user-process. The first digit<BR>denotes whether the response is good, bad or incomplete.<BR>(Referring to the state diagram), an unsophisticated user-process<BR>will be able to determine its next action (proceed as planned,<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR>redo, retrench, etc.) by simply examining this first digit. A<BR>user-process that wants to know approximately what kind of error<BR>occurred (e.g. file system error, command syntax error) may<BR>examine the second digit, reserving the third digit for the finest<BR>gradation of information (e.g., RNTO command without a preceding<BR>RNFR).<BR><BR>There are five values for the first digit of the reply code:<BR><BR>1yz Positive Preliminary reply<BR><BR>The requested action is being initiated; expect another<BR>reply before proceeding with a new command. (The<BR>user-process sending another command before the<BR>completion reply would be in violation of protocol; but<BR>server-</FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> processes should queue any commands that<BR>arrive while a preceding command is in progress.) This<BR>type of reply can be used to indicate that the command<BR>was accepted and the user-process may now pay attention<BR>to the data connections, for implementations where<BR>simultaneous monitoring is difficult. The server-</FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><BR><FONT size=2>process may send at most, one 1yz reply per command.<BR><BR>2yz Positive Completion reply<BR><BR>The requested action has been successfully completed. A<BR>new request may be initiated.<BR><BR>3yz Positive Intermediate reply<BR><BR>The command has been accepted, but the requested action<BR>is being held in abeyance, pending receipt of further<BR>information. The user should send another command<BR>specifying this information. This reply is used in<BR>command sequence groups.<BR><BR>4yz Transient Negative Completion reply<BR><BR>The command was not accepted and the requested action did<BR>not take place, but the error condition is temporary and<BR>the action may be requested again. The user should<BR>return to the beginning of the command sequence, if any.<BR>It is difficult to assign a meaning to "transient",<BR>particularly when two distinct sites (Server- and<BR>User-processes) have to agree on the interpretation.<BR>Each reply in the 4yz category might have a slightly<BR>different time value, but the intent is that the<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR></FONT>
 楼主| 发表于 2005-10-8 23:41:17 | 显示全部楼层
<FONT size=2>user-process is encouraged to try again. A rule of thumb<BR>in determining if a reply fits into the 4yz or the 5yz<BR>(Permanent Negative) category is that replies are 4yz if<BR>the commands can be repeated without any change in<BR>command form or in properties of the User or Server<BR>(e.g., the command is spelled the same with the same<BR>arguments used; the user does not change his file access<BR>or user name; the server does not put up a new<BR>implementation.)<BR><BR>5yz Permanent Negative Completion reply<BR><BR>The command was not accepted and the requested action did<BR>not take place. The User-process is discouraged from<BR>repeating the exact request (in the same sequence). Even<BR>some "permanent" error conditions can be corrected, so<BR>the human user may want to direct his User-process to<BR>reinitiate the command sequence by direct action at some<BR>point in the future (e.g., after the spelling has been<BR>changed, or the user has altered his directory status.)<BR><BR>The following function groupings are encoded in the second<BR>digit:<BR><BR>x0z Syntax - These replies refer to syntax errors,<BR>syntactically correct commands that don't fit any<BR>functional category, unimplemented or superfluous<BR>commands.<BR><BR>x1z Information - These are replies to requests for<BR>information, such as status or help.<BR><BR>x2z Connections - Replies referring to the control and<BR>data connections.<BR><BR>x3z Authentication and accounting - Replies for the login<BR>process and accounting procedures.<BR><BR>x4z Unspecified as yet.<BR><BR>x5z File system - These replies indicate the status of the<BR>Server file system vis-a-vis the requested transfer or<BR>other file system action.<BR><BR>The third digit gives a finer gradation of meaning in each of<BR>the function categories, specified by the second digit. The<BR>list of replies below will illustrate this. Note that the text<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR>associated with each reply is recommended, rather than<BR>mandatory, and may even change according to the command with<BR>which it is associated. The reply codes, on the other hand,<BR>must strictly follow the specifications in the last section;<BR>that is, Server implementations should not invent new codes for<BR>situations that are only slightly different from the ones<BR>described here, but rather should adapt codes already defined.<BR><BR>A command such as TYPE or ALLO whose successful execution<BR>does not offer the user-process any new information will<BR>cause a 200 reply to be returned. If the command is not<BR>implemented by a particular Server-</FONT><a href="http://www.cnpaf.net/class/ftp/" target="_blank" ><FONT size=2>FTP</FONT></A><FONT size=2> process because it<BR>has no relevance to that computer system, for example ALLO<BR>at a TOPS20 site, a Positive Completion reply is still<BR>desired so that the simple User-process knows it can proceed<BR>with its course of action. A 202 reply is used in this case<BR>with, for example, the reply text: "No storage allocation<BR>necessary." If, on the other hand, the command requests a<BR>non-site-specific action and is unimplemented, the response<BR>is 502. A refinement of that is the 504 reply for a command<BR>that is implemented, but that requests an unimplemented<BR>parameter.<BR><BR><st1:chsdate w:st="on" Year="1899" Month="12" Day="30" IsLunarDate="False" IsROCDate="False">4.2.1</st1:chsdate> Reply Codes by Function Groups<BR><BR>200 Command okay.<BR>500 Syntax error, command unrecognized.<BR>This may include errors such as command line too long.<BR>501 Syntax error in parameters or arguments.<BR>202 Command not implemented, superfluous at this site.<BR>502 Command not implemented.<BR>503 Bad sequence of commands.<BR>504 Command not implemented for that parameter.<BR><BR></FONT><U><a href="http://www.cnpaf.net/class/RfcAll/" target="_blank" ><FONT size=2>RFC</FONT></A><FONT size=2>959</FONT></U><FONT size=2> October 1985<BR>File Transfer Protocol<BR><BR>110 Restart marker reply.<BR>In this case, the text is exact and not left to the<BR>particular implementation; it must read:<BR>MARK yyyy = mmmm<BR>Where yyyy is User-process data stream marker, and mmmm<BR>server's equivalent marker (note the spaces between markers<BR>and "=").<BR>211 System status, or system help reply.<BR>212 Directory status.<BR>213 File status.<BR>214 Help message.<BR>On how to use the server or the meaning of a particular<BR>non-standard command. This reply is useful only to the<BR>human user.<BR>215 NAME system type.<BR>Where NAME is an official system name from the list in the<BR>Assigned Numbers document.<BR><BR>120 Service ready in nnn minutes.<BR>220 Service ready for new user.<BR>221 Service closing control connection.<BR>Logged out if appropriate.<BR>421 Service not available, closing control connection.<BR>This may be a reply to any command if the service knows it<BR>must shut down.<BR>125 Data connection already open; transfer starting.<BR>225 Data connection open; no transfer in progress.<BR>425 Can't open data connection.<BR>226 Closing data connection.<BR>Requested file action successful (for example, file<BR>transfer or file abort).<BR>426 Connection closed; transfer aborted.<BR>227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).<BR><BR>230 User logged in, proceed.<BR>530 Not logged in.<BR>331 User name okay, need password.<BR>332 Need account for login.<BR>532 Need account for storing files.</FONT>
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-6-9 18:19 , Processed in 0.054495 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表