📄 rfc520.txt
字号:
RFC 520 A Proposed File Access Protocol Specification 25 June 1973 from server to user; write, from user to server; and both implies connections each ways. Functionally, this command corresponds to RETR or STOR. Therefore, all the FTP parameter commands (TYPE, MODE, etc.) must be sent before the file is opened. If the direction is write (W) and the file specified by the pathname does not exist, there is an implied create with the open. The success of this create, is, of course, dependent on local access privileges and possibly whether or not an ALL command was sent. If applicable, the file created should be of the most general kind of file on which "random" access is allowed. (This is to allow the largest degree of compatibility with operations that may follow). This should be ignored if some site specific command has already specified the kind of file. This command identifies the file on which subsequent operations are to be performed. After the file is opened, the file pointer is at B and any of the other five FAP commands may be sent. It is acknowledged that some systems cannot open a file for access in both directions; an error reply 402 should be sent for this response. Replies ------- 258 451 500 504 550 402 454 501 505 434 455 502 506 4550 457 503 507III.2.2 SETP <argument> This command causes the file pointer to be set to the number specified in the argument. This value will be the ordinal number of the starting position of the next operation. (Byte 0 is the first byte in the file). The argument may take on two other values besides <decimal number> : B, for BEGIN, which sets the file pointer at the beginning of a file (i.e. 0) and E, for END, which sets the file pointer to the last byte in the file. Two error conditions are possible. If the argument specifies an illegal change of file pointer (such as moving it backwards on some systems), then the error reply 402 should be sent. If the argument attempts to move the file pointer off the end of the file, then the EOF: <byte number> reply should be sent with the address of the end of the file (E), and the file pointer left at E. Replies ------- 258 402 480Day [Page 5]RFC 520 A Proposed File Access Protocol Specification 25 June 1973III.2.3 GETP This command requests the server to return the value of the file pointer as a decimal number. Reply ----- 483 504III.2.4 READ <arg> This command instructs the server to move as many bytes as specified (of size logical byte size) from the server to the user. The values the argument may take on are <decimal number> and ALL. ALL is interpreted as all data from the present position of the file pointer to the end-of-file. If a read requests more bytes than in the file, the number of bytes from the present position to the end of file should be transferred and an EOF: <byte number> response returned noting the position of the end of file. If the file is Record structured and a READ requests more bytes than in the record, then the number of bytes in the record from the file pointer are moved and the EOR: <byte number> reply is sent noting the end of record. The action of a READ leaves the file pointer at the position before the read plus the number of bytes moved, (i.e., updated). The EOF condition leaves it at E. Replies ------- 258 480 402 481 450 482 452 500-507 455III.2.5 WRITe <arg> This command instructs the server to accept as many bytes as specified from the user. The result updates the value of the file pointer. The values the argument may take on are <decimal number> or ALL. ALL is interpreted as all data from the present position of the byte pointer to the end-of-file (or beyond). Associated with the write is an implied "append", if necessary previous information has been sent (such as allocation) and if the file's access privilege allow the append. If a write specifies more bytes than there are between the file pointer and the end-of-file, and expansion is not allowed, no data is sent and the file pointer is not moved. An error is returned specifying the byte position of the EOF. If the file isDay [Page 6]RFC 520 A Proposed File Access Protocol Specification 25 June 1973 Record structured and a WRIT attempts to move more bytes than there are in the record, the file pointer is not moved and the EOR: <byte number> reply is sent noting the end of record. Replies ------- 258 480 402 481 450 482 452 500-507 453III.2.6 CLOS This command instructs the server to "close" the presently open file, if any. The receipt of a CLOS without an open file is not an error. The effect is to notify the server that further operations are not directed at the file which is presently open. If an open is received by the server and it has a file open, it should close the open file and open the new one. Reply ----- 258IV. SUMMARYIV.1 SYNTAX OPEN <direction> <pathname> CRLF CLOS CRLF SETP <byte pointer arg> CRLF GETP CRLF READ <transfer argument> CRLF WRIT <transfer argument> CRLF <direction>::= R|W|B <byte pointer argument>::= B|E|<decimal number> <transfer argument>::=ALL|<decimal number> <byte number>::= <decimal number>Day [Page 7]RFC 520 A Proposed File Access Protocol Specification 25 June 1973IV.2 REPLIES USED BY FAP 258 Operation successful 402 Command not implemented for requested value or action 433 Cannot transfer files w/o valid account. Enter account & resend command. 450 FTP: file not found 451 FTP: file access denied 452 FTP: file transfer incomplete, data connection closed. 453 FTP: file transfer incomplete, insufficient storage space. 454 FTP: cannot connect to your data socket 455 FTP: file system error not covered by other reply codes. 457 FTP: transfer parameters in error. 480 EOR: <byte number> 481 EOF: <byte number> 482 File not open for operation 483 FP: <byte pointer> 500 Last command line completely unrecognized. 501 Syntax of last command is incorrect. 502 Last command invalid (ignored), illegal parameter combination. 504 Last command invalid, action not possible at this time. 505 Last command conflicts illegally with previous command(s). 506 Last command not implemented by the server. 507 Catchall error reply. 550 Bad pathname specification (e.g., syntax error). [ This RFC was put into machine readable form for entry ] [ into the online RFC archives by Via Genie ]Day [Page 8]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -