clipper@uwocsd.csd.uwo.ca (Khun Yee Fung) (10/14/90)
This is the ASCII version of AFTP.
Khun Yee
clipper@csd.uwo.ca
----
Anonymous File Transfer Protocol (AFTP)
by
Khun Yee Fung
The University of Western Ontario
September 1990
1. Introduction
The purpose of Anonymous File Transfer Protocol (AFTP) is to
promote sharing of public available programs, documents, and
data. To achieve this objective, AFTP shields the user from
the variations in various file systems and operating systems.
This protocol also allows multiple data transfer
simultaneously. This protocol is specified such that
intelligent, flexible and secure servers and clients can be
written easily.
2. Background
Anonymous FTP has been around for a few years now. Its
popularity is undeniable. You can find lists of anonymous FTP
sites published in newsgroups, anonymous FTP sites for
software requested in newsgroups, and anonymous FTP site given
for software written.
The use of anonymous FTP also rises a lot of concerns.
Foremost is the security of the machines providing this
service. FTP is meant for users to log in to their own
accounts and transfer files from a machine to another machine.
The accounts must exist for the users to log on. Thus
accountability is maintained, albeit remotely. However,
anonymous FTP has the opposite idea of letting anybody to
logon using a common account. Restrictions must then be
applied to ensure the integrity of the file system of the
server machine. Since the FTP server must have a very high
privilege to be able to log on to any user's account, any hole
in the implementation can lead to disaster if a criminal logs
on. I think anonymous FTP is in general unsuitable for FTP
because of this security problem.
Another reason of not having anonymous FTP in FTP is that
there are many different machines around. Each operating
system usually has different convention to name files,
organizes directories, and in general does things differently.
For normal FTP, this is no problem because the user is
expected to know the remote machine well enough to transfer
files from one machine to another. But for anonymous FTP, this
is different. A user can log in on a Tops-10 machine without a
clue as to how to proceed. Directories can be organized in a
bizarre way. Different structures for files and directories
means that automatic programs for transferring files at a set
time from a machine are difficult to write and usually not
general enough to work on all machines.
AFTP tries to aviate these problems. It is designed solely for
anonymous file transfer. It only has to know a limited amount
of files. Therefore, the AFTP server can have the same
privilege as a normal user on a system. It is easy to limit
its knowledge of the machine it is on. On a Unix machine, the
AFTP server can be owned by a ordinary user id. And implement
the server such that only files owned by this user id can be
transferred. This solves the security problem. To solve the
incompatible file systems problem, AFTP defines a fixed format
for directory listings. It decrees that files and directories
must be listed separately. It also provides a
change-to-parent-directory command for tree-structured file
systems.
3. Data Representation
The only recognized data representation in AFTP is the octet.
The server and client are responsible for the conversion of
other representations to octets. As in standard practice,
ASCII characters are converted to octets by adding a zero bit
in the most significant end of the characters. For example, an
ASCII character, 1001001 in binary is converted to a octet,
01001001 in binary.
There is a provision for extending the number of data
representations recognized by AFTP. Up to 10 file types can be
specified. This will be left for future considerations.
Whether to use <CR><LF> or <LF> to delimit lines in a ASCII
file is left to the discretion of the servers and clients. The
server and the client are expected to send files as they are
in the file system, converted to octets if necessary.
4. Terminology
- ASCII: In AFTP, eight-bit ASCII is used. Eight-bit ASCII
characters are derived by adding a zero bit at the most
significant bit of the seven-bit ASCII characters.
- Client: The part of a connection that demands service.
- Client machine: The machine the client is on.
- Command: A series of octets sent by the client to the
server to request service.
- Connection: A communication path between the client and
the server for the exchange of commands, replies, and
data.
- Control Connection: The connection for the server to send
replies and the client to send commands. This connection
exists from the beginning for a AFTP session to the end.
- Control port: The port for the control connection.
- Data connection: The connection for exchanging data. A
data connection is established when a command requiring
data transfer requests a connection through the
specification of a port number. After the data transfer,
a data connection is disconnected.
- Data port: The port for a data connection.
- Directory: A logical container in a file system containing
files. It can contain other directories too.
- Errorcode: The third, fourth, and fifth digit of a return
code.
- File: A series of octets with a size, date of creation and
filename. It has a type of either ASCII, binary, or Tenex.
More file types can be defined when needs arise.
- File position: A pointer in a file after a certain number
of octets.
- Filename: The name of a file in a directory.
- Guest directory: The directory for clients to put files
to. The server can decide whether it wants to have such a
directory.
- Local machine: The machine the client is on.
- Octet: A eight-bit byte.
- Opcode: The first two digits of a return code.
- Path: The name of a file or directory independent of the
current directory. It is assumed that the LF (ASCII 10,
decimal) character is not valid in a path.
- Regexp: Regular expression used to discriminate files to
be shown in a directory listing.
- Remote machine: The machine the server is on.
- Reply: A message sent by the server to indicate success or
failure. It includes a return code with possibly text.
- Return code: A nine digit code sent by the server to signal
success or failure of a n operation demanded by the client.
- Serial number: A serial number is a three-digit decimal
number with leading zeroes from 000 to 999, assigned to a
command by the client. It is used to identify a command.
The server will use this serial number to precisely
acknowledge a command sent by the client. This is
important because multiple commands can be outstanding.
Serial numbers are used to avoid confusion. The assigning
of numbers is up to the client.
- Server: The part of a connection that accepts requests and
manages the AFTP area of a machine.
- Server machine: The machine the server is on.
5. Definitions
5.1 Files and Directories
In AFTP, a virtual file system is defined with the convention
that there are two types of files: directories and regular
files. These two types can never be mixed together in AFTP.
There can be directories in a directory. However, directories
need not be a tree-like structure.
A file has the following attributes: size, date of creation,
and filename. A directory has: date of creation, and directory
name.
The size of a file is the number of octets that would be sent
if this file is to be sent. The date of creation is the date
the file was created. The filename of a file is the name of
the file in its directory.
5.2 Replies
In this protocol, we use a serial-number acknowledgement
scheme. After a command is sent by the client requesting a
service, the server will send back a reply informing the
client whether the requested command has been carried out
correctly or not. A reply contains a return code and possibly
text data after the return code. In every command, there is a
serial number; the return code for a particular command has
the same serial number. Therefore, more than one command can
be sent by the client at one time and the server acknowledges
them separately. A data transfer is finished when the server
closes the data connection. We will discuss more about
multiple commands later on.
A return code always consists of nine digits. The first three
digits constitute the serial number of the command this return
code is acknowledging. The serial number of a command is
assigned by the client. It can be selected arbitrarily. To
avoid confusion, incrementing the serial number for each
command is a good idea but not compulsory. The next two digits
refer to the type of the command this return code is
acknowledging. The next three digits are used to indicate
error or success. The last digit is used for providing
additional information. This last digit is used only in some
commands. In other commands, it is left zero.
Syntax of a reply:
reply = serial space opcode space errorcode space digit data
serial = digit digit digit
data = space text | empty
empty =
opcode = "00" | "01" | "02" | "03" | "04" | "05" |
"06" | "07" | "08" | "09" | "10" | "11" |
"12" | "13" | "14" | "15" | "16" | "99"
errorcode = "000" | "001" | "002" | "003" | "004" |
"005" | "006" | "007" | "008" | "009" |
"010" | "011" | "012" | "013" | "014" |
"015" | "016"
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" |
"7" | "8" | "9"
space = " "
``text'' is a series of octets not containing the line feed
character (ASCII 10 decimal). It can exist only in errorcode
`000'.
In this document, we generally omit the serial number when we
discuss the possible return codes sent by the server.
The set of opcodes and errorcodes can be expanded when needs
arise.
The following is the set of opcodes.
+--------+----------+--------+--------------+
| Opcode | Command | Opcode | Command |
+--------+----------+--------+--------------+
| 00 | continue | 01 | LD |
| 02 | CD | 03 | SD |
| 04 | GF | 05 | PF |
| 06 | ABORT | 07 | GD |
| 08 | TOP | 09 | RF |
| 10 | QUIT | 11 | TIME |
| 12 | TELLME | 13 | IAM |
| 14 | MD | 15 | RD |
| 16 |CDUP | 99 | System error |
+--------+----------+--------+--------------+
Opcode `00' is used in places for signaling success where no
other opcodes are applicable, for example right after
connection. The opcode `99' is used when the server encounters
some system errors that it must terminate the AFTP session or
an illegal command is sent by the client. For both of these
opcodes, the serial number can be any number.
The errorcodes have the following meaning:
- 000. No error. Requested action carried out successfully.
It can have optional text as a means of returning
information requested by the client. Other errorcodes do
not have this property.
- 001. Syntax error. The last digit of the return code
specifies which word is in error.
- 002. Action not done. The client does not have the
privilege to request the action. This is most common when
the client wants to delete a file which it does not have
the permission to.
- 003. No such file or directory. The client has specified a
file or a directory that the server does not know.
- 004. Data transfer failed for some reason. This errorcode
is given when in the middle of a data transfer, something
happened in the server machine and the data connection must
be terminated. This errorcode substitutes the normal
success `000' errorcode.
- 005. This is specific for the commands ``GF'' and ``PF''.
The file position (explained later) specified is too large.
- 006. The server has encountered a problem. It must
terminate the AFTP session. The opcode of this errorcode is
always `99'. This errorcode can be sent anytime the server
encounters a problem, whether a data transfer is taking
place or not.
- 007. No more data connection allowed. The server decides
how many data connections allowed for a control connection.
- 008. The server is not prepared to serve a client. This is
sent right after connection to inform the client that the
server machine's system load is too high or there are too
many AFTP connections.
- 009. Current time is not permitted for a AFTP connection on
server machine. In most machines, AFTP connections are
restricted to a certain period in a day. If AFTP
connections are not permitted at a certain time, this
errorcode should be sent right after the connection. The
opcode for this errorcode is always `99'.
- 010. No such command. The client has sent a command that
the server does not know. The opcode for this errorcode is
always `99'.
- 011. File or directory exists when ``PF'' is requested.
Delete the file before attempting the action.
- 012. File type is given in the last digit. This errorcode
is given when the client requests a file to be sent. The
meaning of the last digit is: 0 -- binary, 1 -- ASCII, 2 --
TENEX. This list can be expanded to others. This code is
sent to inform the client of the type of the file being
sent over. So that the client knows how to reassemble the
file from the octets received from the server.
- 013. The server has waited too long for the client. Timed
out. Two trials should be given. The server should then
terminate the AFTP session. The opcode of this errorcode is
always `99'.
- 014. Signals the client to go ahead with the action or to
get ready for data.
- 015. Currently no command with the serial number specified
is being executed. This command is used to respond to a
``ABORT'' command when the command to be aborted is either
not existing or has been completed.
- 016. Cannot open data connection. The server cannot open a
data connection for reason other than too many data
connections. This errorcode is used before any data
transfer has been done whereas `004' is used when some data
transfer has been done.
5.3 The AFTP Model
For a client to connect to a remote machine, there must be a
server running in the remote machine. The server is expected
to constantly listening to the AFTP port. The client initiates
the control connection by trying to connect to the AFTP port.
The server is expected to accept the connection. Once the
control connection is established, a standard reply is sent
from the server to the client to inform the client whether the
connection is ready (`00 000 0' return code). Or, instead, the
server can inform the client that the system work load for the
remote machine is too great for a new AFTP session (`99 008 0'
return code); or the remote machine does not accept AFTP
connections at current time (`99 009 0' return code). Once
this reply is received, the client can start issuing commands
if the connection is successful or terminate the connection if
not.
Any time the control connection is closed by the client, the
server will close all data connections outstanding. It is the
responsibility of the client to make sure the control
connection is open throughout the AFTP session.
If the client is idle for more than a specific amount of time
(about 15 minutes probably), the server can terminate the AFTP
session after sending two `013' time out errorcodes.
5.4 Data and Control Connections
A AFTP session begins when a control connection is
established. This connection continues until the end of the
AFTP session. Commands and replies are exchanged using this
connection.
When a command requiring data transfer is passed to the
server, it passes a port number to the server at the same
time. This port number represents the port the data transfer
will take place. This port is called the data port. The
connection for the data port is called the data connection. A
data port exists only for the transferring of data of one
command. After the data transfer is over, the data connection
is closed. The client is expected to listen to the port before
issuing a data transfer command. It then sends the command
with the port number. Once the server has received the command
and agrees to the data transfer, the server should try to
connect to the port specified. The client then accepts the
connection and the data transfer can then take place.
When data transfer occurs, the server is expected to monitor
the control connection for further commands sent by the
client. Simultaneous data transfer is possible because of
this policy and the use of the serial number acknowledgement
scheme.
The maximum number of simultaneous data connections allowed
for a single control connection is left to the server to
decide. If this number is exceeded, the server sends a `007'
errorcode to indicate this problem.
A data connection is closed by the party sending data. The
server will send back a reply indicating that it has closed
the data connection or it has noticed the closing of the data
port.
6. Commands
Each command is prefixed by a three-digit serial number, the
command body and terminated by a single LF (Line Feed, ASCII
10 decimal). There should be at least one space character
between words in the commands, no space characters are allowed
between the beginning of the command and the first character
of the command, and no space characters are allowed after the
last character and the end of the command. Cases of the words
in a command are always significant so that `LD' is different
from `ld'. We will omit the serial number in the explanations
here. They must exist in each command sent by the client. No
command can have more than 1024 octets, including the Line
Feed character at the end of the command.
For commands requiring a data port for data transfer, the
client should open the data port and wait for the server to
signal `go ahead' by sending a `014' errorcode. It can then
receive or send data using the data port. If the client sends
data, it should close after data has been sent. The server
should close the data connection after the server has sent all
the data. After the data has been sent, the server should send
either `000' errorcode to signal success, or `004' to signal
failed data transfer to the client.
Syntax of a command:
aftp-command = serial space command
command = LD-command | CD-command | SD-command |
GF-command | PF-command | ABORT-command |
GD-command | RF-command | QUIT-command |
TIME-command | TELLME-command |
IAM-command | TOP-command | MD-command
RD-command | CDUP-command
space = " "
6.1 LD, list a directory
Lists a directory and show the files or directories in the
current directory. The syntax of the command, in BNF:
LD-command = "LD" port "FULL" order regexp |
"LD" port order type regexp
order = "ALPHA" | "TIME"
type = "FILE" | "DIR"
regexp = alt | reg | empty
alt = "(" reg ")" "|" alt | "(" reg ")"
reg = kleene | plus | charcl | any | char |
kleene reg | plus reg | charcl reg |
char reg | any reg
plus = char "+" | any "+"
chars = char | char "-" char | char chars |
char "-" char chars
suffix = "+" | "*" | empty
neg = "^" | empty
charcl = "[" neg chars "]" suffix
kleene = char "*" | any "*"
any = "?"
empty =
port = eightbit "," eightbit "," eightbit ","
eightbit "," eightbit "," eightbit
``eightbit'' is a number from 0 to 255. The first four numbers
in ``port'' constitutes the IP address of the client machine.
The last two numbers represent the 32-bit TCP port number. To
convert the 32-bit port number to two ``eightbit''s, divide
the port number by 256. The quotient is the first ``eightbit''
number, and the remainder is the second ``eightbit'' number.
To get the meta-characters used in the regular expressions,
add ``\'' in front of the character to be escaped. The
sequence ``\\'' yields a single ``\''. There are a few special
characters that can be specified only by using the escape
mechanism. They are line feed (\n ASCII 10 decimal), tab (\t
ASCII 9 decimal), carriage return (\r ASCII decimal 13),
backspace (\b ASCII 8 decimal) and form feed (\f ASCII 12
decimal). These special characters, and other regular
characters constitute the syntax category ``char'' in the BNF
above.
Only files and directories that can be read by the client
should be listed by this command.
When ``FULL'' is specified, all files accessible by AFTP
should be listed in the order selected by the command. Ordered
by ``ALPHA'' means that files are ordered in their
alphabetical order. For characters other than the alphabets,
the order is chosen according to their ASCII values. Ordered
by ``TIME'' means the files should be listed according to how
recently they were created. The least recent file is sent
first and the most recent file is sent last.
Either ``FILE''s can be listed or ``DIR''ectories can be
listed, but not both. If ``regexp'' exists, it is used to
discriminate the files or directories to be listed. Only files
or directories with filenames matching the ``regexp'' will be
listed. The semantics of ``regexp'' is almost identical to the
usual Unix regular expressions.
The output of the ``LD'' command is standardized. For regular
files, each line of the output should be in the following
form, with white spaces (tabs and space characters) separating
the fields:
size date filename
Where ``size'' is the size of the file, ``date'' the date of
creation of the file, and ``filename'' the filename of the
file. Each line of listing is delimited by a single LF
(line-Feed ASCII 10 decimal) character.
The field ``date'' is a decimal number representing the number
of seconds since 00:00:00 GMT, Jan. 1, 1970. Files created
before that time has negative numbers for their dates.
The syntax for ``date'' is:
date = neg number
neg = "-" | empty
number = digit number | digit
For directory listings, each line should have the following
format, with white spaces (tab or space characters) separating
the fields:
date directory-name
Where ``date'' is the date of creation, and ``directory-name''
the name of the directory. Each line of listing should be
delimited by a single LF (line-Feed ASCII 10 decimal)
character.
A `01 014 0' return code will be sent if the request is
successful. The client should expect the listing to follow
from the data port it specified. After the end of the listing,
a `01 000 0' return code will be sent to indicate the end of
the listing. Other return codes relevant for this command are:
+-------------+----------------------------------------+
| Return code | Explanation |
+-------------+----------------------------------------+
| 01 001 X | Syntax error in word X |
| 01 003 0 | Directory not found |
| 01 007 0 | No more data connection allowed |
| 01 016 0 | The server cannot open data connection |
+-------------+----------------------------------------+
6.2 CD, change current directory
CD changes the current directory. The current directory is
only useful for the user.
Syntax:
CD-command = "CD" file
file = filename | path
The syntax for ``filename'' and ``path'' is system-dependent.
However, it is always assumed that the LF character (ASCII 10
decimal) is not a valid character in them.
+-------------+------------------------+
| Return code | Explanation |
+-------------+------------------------+
| 02 000 0 | Success |
| 02 001 X | Syntax error in word X |
| 02 003 0 | Directory not found |
+-------------+------------------------+
6.3 SD, show current directory
Syntax:
SD-command = "SD"
SD shows the name of the current directory. This is meant for
the user only. The path of the directory should be returned by
the server. If successful, a `03 000 0' return code will be
returned by the server with the current directory follows.
Syntax of the output:
SD-reply = serial " 03 000 0 " path
Other return codes:
+-------------+------------------------+
| Return code | Explanation |
+-------------+------------------------+
| 03 001 X | Syntax error in word X |
+-------------+------------------------+
6.4 GF, get a file from the server
The syntax for this command is:
GF-command = "GF" port number file
The file matches the file should be sent from the server,
starting from the position after ``number''. For example, ``GF
10 pub/readme.txt'' means getting the file named
``pub/readme.txt'' starting from the 11th octet from the
beginning of the file.
If successful, the server will send back `04 012 X', where `X'
is the file type of the file to be sent. The client should
then expect to receive the contents of the file from the data
connection it specified. The server will then send `04 000 0'
to signal completion of the data transfer.
The types of files supported right now is ASCII and binary.
Tenex file type is defined but not supported. The numeric
representation for ASCII file is 1, and 0 for binary.
+-------------+-----------------------------------------------------+
| Return code | Explanation |
+-------------+-----------------------------------------------------+
| 04 001 X | Syntax error in word X |
| 04 003 0 | Directory not found |
| 04 005 0 | The file position specified is larger than the file |
| 04 007 0 | No more data connection allowed |
| 04 016 0 | The server cannot open data connection |
+-------------+-----------------------------------------------------+
6.5 PF, put a file to server machine
The syntax of the PF command is:
PF-command = "PF" port number length type file
type = "BIN" | "ASCII" | "TENEX"
length = number
``number'' is the file position to start putting the file. The
file type is sent on the command line to the server so that
the servers knows how to store the file being sent from the
client. The number of file types can be expanded by two
agreeing machines.
If successful, the server will send back `05 014 0'. The
client should then send the contents of the file using the
data port specified. The server will then send `05 000 0' to
signal completion of the data transfer. All files sent from
the client to the server will reside in the guest directory.
To change to the guest directory, use the ``GD'' command. If
the syntax of the filename is not valid on the server machine,
the server is responsible for the renaming of the file. It can
do it in anyway it deems appropriate. The file types it
supports can be expanded when need arises.
+-------------+-----------------------------------------------------+
| Return code | Explanation |
+-------------+-----------------------------------------------------+
| 05 001 X | Syntax error in word X |
| 05 002 0 | Guest directory does not exist |
| 05 005 0 | The file position specified is larger than the file |
| 05 007 0 | No more data connection allowed |
| 05 011 0 | The named file exists |
| 05 016 0 | The server cannot open the data connection |
+-------------+-----------------------------------------------------+
6.6 ABORT, abort an executing command
Syntax:
ABORT-command = "ABORT" serial
This command terminates the execution of the command
identified by the serial number. The response from the server
is:
+-------------+------------------------------------+
| Return code | Explanation |
+-------------+------------------------------------+
| 06 000 0 | Success |
| 06 001 X | Syntax error in word X |
| 06 015 0 | No command with such serial number |
+-------------+------------------------------------+
The serial number in the reply should be the serial number of
the ``ABORT'' command, not the command the ``ABORT'' command
is trying to abort. This command can only be used to abort
multiple step commands, namely, ``LD'', ``PF'', ``GF'', and
``TELLME''.
6.7 GD, change to guest directory
Syntax:
GD-command = "GD"
If the guest directory exists, the server changes current
directory to the guest directory and return its path using `07
000 0' return code with the path after the return code and
before the line feed of the return code.
The syntax of the output:
GD-reply = serial " 07 000 0 " path
Other return codes are:
+-------------+--------------------------------+
| Return code | Explanation |
+-------------+--------------------------------+
| 07 001 X | Syntax error in word X |
| 07 002 0 | Guest directory does not exist |
+-------------+--------------------------------+
6.8 TOP, change to the top directory
This command changes the current directory to the directory
AFTP puts the client on when the control connection was first
established.
Syntax:
TOP-command = "TOP"
The server returns a `08 000 0' return code after the
operation is carried out. `08 001 X' is returned if the server
encounters a syntax error in word `X'.
6.9 RF, delete a file
Syntax:
RF-command = "RF" file
The file named is deleted. The server decides whether this
command will succeed. The file to be deleted must be in the
guest directory. Files in other directories are not allowed
to be deleted by a client.
+-------------+---------------------------------------+
| Return code | Explanation |
+-------------+---------------------------------------+
| 09 000 0 | Success |
| 09 001 X | Syntax error in word X |
| 09 002 0 | Client not allowed to delete the file |
| 09 003 0 | The named file does not exist |
+-------------+---------------------------------------+
6.10 QUIT, terminate AFTP session
Syntax:
QUIT-command = "QUIT"
Everything being done should be aborted and the session
terminated.
+-------------+------------------------+
| Return code | Explanation |
+-------------+------------------------+
| 10 000 0 | Success |
| 10 001 X | Syntax error in word X |
+-------------+------------------------+
After send `10 000 0', the server can severe the control
connection. All data connections are also closed with no
warning sent from the server.
6.11 TIME, show the time of the server machine
Syntax:
TIME-command = "TIME"
The time of the local machine of the server should be
returned. The syntax for specifying a date is the same as the
``date'' syntax in command ``LD''.
The server sends back `11 000 0' if the server agrees to send
back the local time. The time is given after the return code
and before the line feed of the reply.
The syntax of the reply is:
TIME-reply = serial " 11 000 0 " date
The server sends back `11 001 X' if it found a syntax error in
word `X'.
6.12 TELLME, print introduction
Syntax:
TELLME-command = "TELLME" port
This command requests the server to send the introduction of
the server machine. This command is allowed to fail if the
server machine does not have such a file.
If successful, the server sends back `12 014 0' if it is ready
to send the file. The client should expect to receive data
from the data port it specified. The server then sends `12 000
0' to signal the completion of the transfer.
The server sends back `12 001 X' if it found a syntax error in
word `X'. The server send back a `12 007 0' return code if no
more data connections are allowed. The server sends `12 016 0'
if it cannot open the data port requested by the client.
6.13 IAM, identifying client
This commands identifies the client. This can be the first
command sent by the client after connection. Syntax:
IAM-command = "IAM" username
Everything after the command word ``IAM'' until the end of
line is taken to be the username.
The server sends back `13 000 0' if the operation is
successful. The server sends back `13 001 X' if it found
syntax error in word `X'.
6.14 MD, create a directory
The syntax of the MD command is:
MD-command = "MD" filename
If successful, the server will send back `05 000 0'. A
directory should not be allowed to be created in places other
than in the guest directory. It is up to the server to enforce
this. If the filename is not valid on the server machine, the
server is responsible for the renaming of the file. It can do
it in anyway it deems appropriate. The other responses are:
+-------------+--------------------------+
| Return code | Explanation |
+-------------+--------------------------+
| 14 001 X | Syntax error in word X |
| 14 002 0 | Directory is not created |
| 14 011 0 | The named file exists |
+-------------+--------------------------+
6.15 RD, remove a directory
Syntax:
RF-command = "RF" file
The file named is deleted. The server decides whether this
command will succeed. The directory to be deleted must be in
the guest directory. Directories in other directories are not
allowed to be deleted by a client. The server decides whether
a non-empty directory can be deleted or not.
+-------------+--------------------------------------------+
| Return code | Explanation |
+-------------+--------------------------------------------+
| 15 000 0 | Success |
| 15 001 X | Syntax error in word X |
| 15 002 0 | Client not allowed to delete the directory |
| 15 003 0 | The named directory does not exist |
+-------------+--------------------------------------------+
6.16 CDUP, change to the parent of the current directory
Syntax:
CDUP-command = "CDUP"
This command changes directory to be the parent of the current
directory. Only file systems with tree-structured directories
should allow this. The successful execution of this command
should return `16 000 0'.
Other return codes:
+-------------+-----------------------------------------------+
| Return code | Explanation |
+-------------+-----------------------------------------------+
| 16 001 X | Syntax error in word X |
| 16 002 0 | This command is not valid in this file system |
+-------------+-----------------------------------------------+
The parent of the root directory is the root itself. The
server should be careful not to change directory beyond the
AFTP area.
7. References
Jon Postel, and Joyce Reynolds, ``File Transfer Protocol'',
`rfc 959', ISI, October 1985.
8. Author Information
Khun Yee Fung
Department of Computer Science
Middlesex College
The University of Western Ontario
London, Ontario
N6A 5B7
Canada
clipper@csd.uwo.ca
--
----
In Real life: Khun Yee Fung clipper@csd.uwo.ca (Internet)
Alternative: 4054_3267@UWOVAX.BITNET
UUCP: ...!{ihnp4|decvax|seismo}!{watmath|utzoo}!ria!csd!clipper
Department of Computer Science
Middlesex College
The University of Western Ontario
London, Ontario, N6A 5B7 CANADA