RFC775

xiaoxiao2021-03-06  111

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 "" in TOPS-20.

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 , the new subdirectory can only be specified using the name . Even on UNIX and MULTICs, the parameters given in XMKD may not be appropriate. If it is a "relative" path name (that is, a pathname is considered to be related to the current directory), the user wants to reach the subdirectory must only be used in the same current directory. If depends on the application, it will be inconvenient. It will not be very robust in any case. To resolve these issues, the server should return a line table outside of the command to successfully complete the XMKD:

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 "" DIRECTORY CREATED

XCWD Overrainbow

431 No Such Directory

XCWD

200 Working Directory Changed

XCWD

200 Working Directory Changed to

Xmkd

257 "" Directory Created

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 directory is an upper list. At the same time, in the first example, the user "violates" protocol, trying to use a directory that is different from the name returned by TOPS-20. There may be problems in the presence of the directory; this is some of some TOPS-20 execution in an inherent uncertainty. XRMK commands also need to make a similar consideration. This is: don't consider where operation, in order to indicate the relevant absolute path name, violate the host's practice, the host will treat the operation of XMKD and KRMD as a subdirectory operation. The answer to the XMKD command must contain the absolute path name of the creation of the directory. Reference

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

转载请注明原文地址:https://www.9cbs.com/read-126000.html

New Post(0)