Organization: China Interactive Publishing Network (http://www.china-pub.com/)
RFC Document Chinese Translation Program (http://www.china-pub.com/compters/emook/aboutemook.htm)
E-mail: Ouyang@china-pub.com
Translator: prince1680 (prince1680 prince1680@163.com)
Translation time: 2001-4-20
Copyright: This Chinese translation copyright belongs to China Interactive Publishing Network. Can be used for non-commercial use free reprint, but the translation and copyright information of this document must be retained.
FTP command for directory
(RFC 775 Directory Oriented FTP Commands)
David Mankins (DM @ BBN-UNIX)
Dan Franklin (Dan @ BBN-UNIX)
A. D. Owen (Adowen @ bbnd)
As part of the ARPA network remote site maintenance engineering (RSM), BBN is required to install and maintain software on several PDP-11 running a UNIX operating system. Because the UNIX system has a tree directory structure, in this structure, the operation of the directory is as easy to operate as a normal file operation, we find that the FTP server can be extended on these machines to include commands involving directory creation.
Because other hosts including TOPS-20 and Multics are present on the ARPA network, we try to make these commands as a regular command as much as possible.
We added four commands on the server:
XMKD Child
Create a directory called "Child".
XRMD CHILD
Delete the directory called "Child".
XPWD
Print the current working directory.
XCUP
Change the directory to the parent directory of the current working directory.
The "child" parameter will be created (delete) as the subdirectory of the current working directory unless "child" string contains enough information to indicate other servers, for example, "Child" is an absolute path name (in Multics and UNIX) Or something in the CHLID image "
Answer code
The XCUP command is a special case in XCWD, which is included in a simple execution program that is transmitted between the operating system named different grammar on the parent directory. So we recommend XCUP's answer code is the same as the XCWD answer code. Similarly, we recommend XRMD's answer codes and command Dele's answer codes deleted with their similar files.
However, XMKD's answer code is more complicated. A newly created directory may be the future goal of the XCWD command. Unfortunately, the parameters of XMKD cannot always be the appropriate parameters of XCWD. There is a case here, for example, on TOPS-20, a subdirectory can be created with just in the case where the name is given. That is, on the FTP of TOPS-20 servers, the following command sequences
XMKD MYDIR
XCWD MYDIR
Will be wrong. A new directory may only specify only "absolute" name; for example, if the above XMKD command is used in the directory
257
That is, the server tells the user what string to use when creating a directory. The directory name can contain any characters; embedded dual quotes use dual quotes ("Dual reference" conventions). For example, the user enters the directory / usr / dm and creates a subdirectory for Child:
XCWD / USR / DM
200 Directory Changed to / USR / DM
XMKD Child
257 "/ usr / dm / child" Directory CREATED
An example with an in-line double quotation mark:
XMKD foo "bar
257 "/ usr / dm / foo" "bar" Directory CREATED
XCWD / USR / DM / FOO "BAR
200 Directory Changed to / USR / DM / FOO "BAR
If there is an identical subdirectory, we believe should be interpreted as an error. In this case, the server should give "Access Denied" error answers.
CWD / USR / DM
200 Directory Changed to / USR / DM
XMKD Child
521 - "/ usr / dm / child" Directory Already EXISTS;
TAKING NO ACTION.
We recommend XMKD's failure answer is similar to the file creation command Stor.
Similarly, if a file with the subdirectory is seized with subdirectories, we also recommend returning "Access Denied" (this is a problem on UNIX, but not TOP-20).
Since the XPWD command is completed with the XMKD command to return the same type of information, we also apply 257 answer code to indicate that this command succeeds in success. Here we submit a summary of a test command. The code given outside the parentheses is consistent with RFC691; it is the code of the old protocol recommended by the RFC. Both BBN-UNIX servers and user programs do this.
Answer code 257 is the only new code. The answer codes shown in parentheses are "new" FTP protocol, most of which have recently been recorded in RFC765.
The code for the RFX765 protocol is 251.
Command: answer code explanation
XMKD creates a directory
257 (251) "Pathname" Created ("Pathname" has been created)
521 (450) "Pathname" Already EXISTS ("Pathname" already exists)
506 (502) Action Not Implement (Operation Operation)
521 (450) Access Denied 550 (501) BAD PATHNAME SYNTAX OR AmbIGUOS (Error or Unclear path name)
425 (451) Random File System Error (Random File System Error)
XCUP changes to the previous directory
200 (200) WORKING DIRECTORY CHANGED (Work Directory has changed)
506 (502) Action Not Implement (Operation Operation)
507 (551) No Superior Directory (no previous directory)
521 (450) Access Denied (Refusal)
425 (451) Random File System Error (Random File System Error)
XRMD Delete Directory
224 (250) DELETED OK (Delete Completion)
506 (502) Action Not Implement (Operation Operation)
521 (450) Access Denied (Refusal)
550 (501) BAD PATHNAME SYNTAX OR AmbIGUOUS (error or unclear path name)
425 (451) Random File System Error (Random File System Error)
XPWD Print Current Work Contents
257 (251) "Pathname" ("path name")
425 (451) Random File System Error (Random File System Error)
506 (502) Action Not Implement (Operation Operation)
Subtleties
Because these commands are very useful between the directory tree between the machine, we must emphasize such a fact that XMKD parameters should be interpreted as subdirectory in the current working directory unless it contains sufficient destination host information that can illustrate other situations.
Below is an example of imaginary in TOPS-20:
XCWD
200 Working Directory Changed
XMKD Overrainbow
257 "
XCWD Overrainbow
431 No Such Directory
XCWD
200 Working Directory Changed
XCWD
200 Working Directory Changed to
Xmkd
257 "
XCWD
Note that the first example establishes a subdirectory in a connection. In contrast, the parameter of the second example is TOPS-20 contains enough information, indicating that the
File Transfer Protocol (RFC 765), Postel, J., June 1980
CWD Command of FTP (RFC 697), LIEB, J., NIC 32963, 14 JULY 1975
One More Try On The FTP (RFC 691), Harvey, B., NIC 32700, 28 May
1975
Revised FTP Reply Codes (RFC 640), Postel, J., N. Neigus, K.
Pogran, NIC 30843, 5 June 1974
File Transfer Protocol (RFC 542), Neigus, N., NIC 17759, 12 JULY
1977
RFC775 Directory Oriented FTP Commands RFC775 FTP Command for Directory
1
4
RFC Document Chinese Translation Program