跳到主要内容

拟议 NETRJE 的应答码

本协议的应答码将遵循 RFC 640 中为新 FTP 规范提出的模型。作为提醒,我们把该 RFC 中的相关信息插入于此:

应答码的第一位数字有五种取值:

1yz 肯定的初步应答(Positive Preliminary reply)

所请求的动作正在启动;在继续发送新命令之前,应等待另一条应答。(用户进程在完成应答之前发送另一条命令,将违反协议;但服务器 FTP 进程应当把在前一条命令执行期间到达的任何命令排入队列。)对于难以同时监视的实现,此类应答可用来表明命令已被接受,用户进程现在可以关注数据连接了。

2yz 肯定的完成应答(Positive Completion reply)

所请求的动作已成功完成。可以发起新的请求。

3yz 肯定的中间应答(Positive Intermediate reply)

命令已被接受,但所请求的动作被搁置,等待进一步的信息。用户应发送另一条命令来指定这些信息。此类应答用于命令序列组。

4yz 暂时性否定完成应答(Transient Negative Completion reply)

命令未被接受,所请求的动作没有发生,但该错误状况是暂时的,可以再次请求该动作。用户应返回命令序列(如果有)的开头。很难为“暂时性”赋予一个确切含义,尤其是当两个不同的站点(服务器与用户进程)必须对其解释达成一致时。4yz 类别中的每条应答可能有略微不同的时间值,但其用意是鼓励用户进程再次尝试。判断某条应答属于 4yz 还是 5yz(永久性否定)类别的经验法则是:如果命令可以在命令形式或用户、服务器的属性不作任何改变的情况下重复执行(例如,命令拼写相同、使用相同的参数,用户没有改变其文件访问权限或用户名,服务器没有推出新的实现),则应答属于 4yz。

5yz 永久性否定完成应答(Permanent Negative Completion reply)

命令未被接受,所请求的动作没有发生。不鼓励用户进程重复完全相同的请求(在相同的序列中)。即使某些“永久性”错误状况也是可以纠正的,因此真人用户可能希望在将来某个时刻(例如拼写已被更正之后,或用户已改变其目录状态之后),通过直接操作指示其用户进程重新发起命令序列。

第二位数字编码了以下功能分组:

x0z 语法(Syntax)——这些应答涉及语法错误、语法正确但不属于任何功能类别的命令,以及未实现或多余的命令。

x1z 信息(Information)——这些是对信息请求(例如状态或帮助)的应答。

x2z 连接(Connection)——涉及 Telnet 连接和数据连接的应答。

x3z 认证与记账(Authentication and accounting)——用于登录过程和记账过程的应答。

x4z 尚未指定。

x5z 文件系统(File system)——这些应答表明服务器文件系统相对于所请求的传输或其他文件系统动作的状态。

第三位数字在第二位数字所指定的每个功能类别中给出更细的含义划分。下面的应答列表将对此加以说明。请注意,与每条应答相关联的文本是建议性的,而非强制性的,甚至可能因与之相关的命令而异。另一方面,应答码则应严格遵循规范。也就是说,服务器实现不应为仅与此处所述略有不同的情形发明新的应答码,而应当调整使用已定义的应答码。

下面是按应答码排序的应答列表。为 RJE 新增了一些应答,这些应答以星号标出,以便读者识别。该列表之后是命令列表,列出每条命令可能的应答。该列表不被认为是完整或最终的;与往常一样,欢迎提出意见。

110 Restart marker reply,

   In this case the text is exact and not left to the particular
   implementation; it must read:

      MARK yyyy = mmmm

   where yyyy is user-process data stream marker, and mmmm is Server's
   equivalent marker.  (Note the spaces between the markers and "=".)

120 Service ready in nnn minutes

125 Data connection already open; transfer starting

150 File status okay; about to open data connection

200 Command okay

202 Command not implemented, superfluous at this site

211 System status, or system help reply

212 Directory status

213 File status

214 Help message (on how to use the server or the meaning of a
particular non-standard command.  This reply is useful only to the human
user.)

*215 RJE general status reply

*216 job status reply

*217 RJE user's jobs status reply

220 Service ready for new user

221 Service closing TELNET connecton (logged off if appropriate)

225 Data connection open; no transfer in progress

226 Closing data connection; requested file action successful (for
example, file transfer or file abort.)

227 Entering [passive, active] mode

230 User logged in

250 Requested file action okay, completed

*260 Job <job-id> has completed

*261 Output ready.  Type an empty line when ready

*262 Job <job-id> IS ALLOCATED  pathname

*263 Job <job-id> cancelled as requested

*264 Job <job-id> altered as requested to state status

331 User name okay, need password

332 Need account for login

350 Requested file action held in abeyance, pending further information

354 Start mail input; end with CRLF, CRLF

*360 Job <job-id> successfully submitted

421 Service not available, closing Telnet connecton.  (This may be a
reply to any command if the service knows it must shut down.)

425 Can't open data connection

426 Connection trouble, closed; transfer aborted

450 Requested file action not taken; file unavailable (e.g., file not
found, no access)

451 Requested action aborted; local error in processing

452 Requested action not taken:  insufficient storage space in system

500 Syntax error, command unrecognized  (This may include errors such as
command line too long.)

501 Syntax error in parameters or arguments

502 Command not implemented

503 Bad sequence of commands

504 Command not implemented for that parameter

530 Not logged in

532 Need account for storing files

550 Requested action not taken: file unavailable (e.g., file busy)

552 Requested file action aborted:  exceeded storage allocation for
current directory or dataset)

553 Requested action not taken:  file name not allowed

*563 Job <job-id> is not known to the system

*564 Requested alteration is not permitted for the specified job.