📄 rfc765.txt
字号:
command, as some sites may require an account for login and
others only for specific access, such as storing files. In
the latter case the command may arrive at any time.
There are reply codes to differentiate these cases for the
automaton: when account information is required for login,
the response to a successful PASSword command is reply code
332. On the other hand, if account information is NOT
required for login, the reply to a successful PASSword
command is 230; and if the account information is needed for
a command issued later in the dialogue, the server should
22
IEN 149 June 1980
RFC 765 File Transfer Protocol
return a 332 or 532 reply depending on whether he stores
(pending receipt of the ACCounT command) or discards the
command, respectively.
REINITIALIZE (REIN)
This command terminates a USER, flushing all I/O and account
information, except to allow any transfer in progress to be
completed. All parameters are reset to the default settings
and the TELNET connection is left open. This is identical
to the state in which a user finds himself immediately after
the TELNET connection is opened. A USER command may be
expected to follow.
LOGOUT (QUIT)
This command terminates a USER and if file transfer is not
in progress, the server closes the TELNET connection. If
file transfer is in progress, the connection will remain
open for result response and the server will then close it.
If the user-process is transferring files for several USERs
but does not wish to close and then reopen connections for
each, then the REIN command should be used instead of QUIT.
An unexpected close on the TELNET connection will cause the
server to take the effective action of an abort (ABOR) and a
logout (QUIT).
TRANSFER PARAMETER COMMANDS
All data transfer parameters have default values, and the
commands specifying data transfer parameters are required only
if the default parameter values are to be changed. The default
value is the last specified value, or if no value has been
specified, the standard default value as stated here. This
implies that the server must "remember" the applicable default
values. The commands may be in any order except that they must
precede the FTP service request. The following commands
specify data transfer parameters.
DATA PORT (PORT)
The argument is a HOST-PORT specification for the data port
to be used in data connection. There defaults for both the
user and server data ports, and under normal circumstances
this command and its reply are not needed. If this command
23
June 1980 IEN 149
File Transfer Protocol RFC 765
is used the argument is the concatenation of a 32-bit
internet host address and a 16-bit TCP port address. This
address information is broken into 8-bit fields and the
value of each field is transmitted as a decimal number (in
character string representation). The fields are separated
by commas. A port command would be:
PORT h1,h2,h3,h4,p1,p2
where, h1 is the high order 8 bits of the internet host
address.
PASSIVE (PASV)
This command requests the server-DTP to "listen" on a data
port (which is not its default data port) and to wait for a
connection rather than initiate one upon receipt of a
transfer command. The response to this command includes the
host and port address this server is listening on.
REPRESENTATION TYPE (TYPE)
The argument specifies the representation type as described
in the Section on Data Representation and Storage. Several
types take a second parameter. The first parameter is
denoted by a single TELNET character, as is the second
Format parameter for ASCII and EBCDIC; the second parameter
for local byte is a decimal integer to indicate Bytesize.
The parameters are separated by a <SP> (Space, ASCII code
32.).
The following codes are assigned for type:
\ /
A - ASCII | | N - Non-print
|-><-| T - TELNET format effectors
E - EBCDIC| | C - Carriage Control (ASA)
/ \
I - Image
L <byte size> - Local byte Byte size
The default representation type is ASCII Non-print. If the
Format parameter is changed, and later just the first
argument is changed, Format then returns to the Non-print
default.
24
IEN 149 June 1980
RFC 765 File Transfer Protocol
FILE STRUCTURE (STRU)
The argument is a single TELNET character code specifying
file structure described in the Section on Data
Representation and Storage.
The following codes are assigned for structure:
F - File (no record structure)
R - Record structure
P - Page structure
The default structure is File.
TRANSFER MODE (MODE)
The argument is a single TELNET character code specifying
the data transfer modes described in the Section on
Transmission Modes.
The following codes are assigned for transfer modes:
S - Stream
B - Block
C - Compressed
The default transfer mode is Stream.
FTP SERVICE COMMANDS
The FTP service commands define the file transfer or the file
system function requested by the user. The argument of an FTP
service command will normally be a pathname. The syntax of
pathnames must conform to server site conventions (with
standard defaults applicable), and the language conventions of
the TELNET connection. The suggested default handling is to
use the last specified device, directory or file name, or the
standard default defined for local users. The commands may be
in any order except that a "rename from" command must be
followed by a "rename to" command and the restart command must
be followed by the interrupted service command. The data, when
transferred in response to FTP service commands, shall always
be sent over the data connection, except for certain
informative replies. The following commands specify FTP
service requests:
25
June 1980 IEN 149
File Transfer Protocol RFC 765
RETRIEVE (RETR)
This command causes the server-DTP to transfer a copy of the
file, specified in the pathname, to the server- or user-DTP
at the other end of the data connection. The status and
contents of the file at the server site shall be unaffected.
STORE (STOR)
This command causes the server-DTP to accept the data
transferred via the data connection and to store the data as
a file at the server site. If the file specified in the
pathname exists at the server site then its contents shall
be replaced by the data being transferred. A new file is
created at the server site if the file specified in the
pathname does not already exist.
APPEND (with create) (APPE)
This command causes the server-DTP to accept the data
transferred via the data connection and to store the data in
a file at the server site. If the file specified in the
pathname exists at the server site, then the data shall be
appended to that file; otherwise the file specified in the
pathname shall be created at the server site.
MAIL FILE (MLFL)
The intent of this command is to enable a user at the user
site to mail data (in form of a file) to another user at the
server site. It should be noted that the files to be mailed
are transmitted via the data connection in ASCII or EBCDIC
type. (It is the user's responsibility to ensure that the
type is correct.) These files should be inserted into the
destination user's mailbox by the server in accordance with
serving Host mail conventions. The mail may be marked as
sent from the particular user HOST and the user specified by
the 'USER' command. The argument field may contain a Host
system ident, or it may be empty. If the argument field is
empty or blank (one or more spaces), then the mail is
destined for a printer or other designated place for general
delivery site mail.
26
IEN 149 June 1980
RFC 765 File Transfer Protocol
MAIL (MAIL)
This command allows a user to send mail that is NOT in a
file over the TELNET connection. The argument field may
contain system ident, or it may be empty. The ident is
defined as above for the MLFL command. After the 'MAIL'
command is received, the server is to treat the following
lines as text of the mail sent by the user. The mail text
is to be terminated by a line containing only a single
period, that is, the character sequence "CRLF.CRLF". It is
suggested that a modest volume of mail service should be
free; i.e., it may be entered before a USER command.
MAIL SEND TO TERMINAL (MSND)
This command is like the MAIL command, except that the data
is displayed on the addressed user's terminal, if such
access is currently allowed, otherwise an error is returned.
MAIL SEND TO TERMINAL OR MAILBOX (MSOM)
This command is like the MAIL command, except that the data
is displayed on the addressed user's terminal, if such
access is currently allowed, otherwise the data is placed in
the user's mailbox.
MAIL SEND TO TERMINAL AND MAILBOX (MSAM)
This command is like the MAIL command, except that the data
is displayed on the addressed user's terminal, if such
access is currently allowed, and, in any case, the data is
placed in the user's mailbox.
MAIL RECIPIENT SCHEME QUESTION (MRSQ)
This FTP command is used to select a scheme for the
transmission of mail to several users at the same host. The
schemes are to list the recipients first, or to send the
mail first.
MAIL RECIPIENT (MRCP)
This command is used to identify the individual recipients
of the mail in the transmission of mail for multiple users
at one host.
27
June
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -