IV.A.3-IV.A.4 FTP Service and Miscellaneous Commands
IV.A.3 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), except that ASCII characters must be used (in conformance with the TELNET Protocol). The suggested default handling is to use the last specified device, directory or file name, or the standard default defined for local users. The command may be in any order except that a "rename from" command, must be followed by a "rename to" command, and some servers may require an "allocate" command before a "store" command. The data, when transferred in response to FTP service commands, shall always be sent over the data connection. The following commands specify FTP service requests:
Retrieve (RETR) - This command achieves the transfer of a copy of the file specified in the pathname, from server to user site. The status and contents of the file at the server site shall be unaffected.
Store (STOR) - This command achieves the transfer of a copy of a file from user to server site. If the file specified in the pathname exists at the server site, then its contents shall be replaced by the contents of the file 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 achieves the transfer of data from using to serving site. If the file specified in the pathname exists at the server site, then the data transferred shall be appended to that file, otherwise the file specified in the pathname shall be created at the server site.
Allocate (ALLO) - This command may required by some servers to reserve sufficient storage to accommodate the new file to be transferred. The argument field shall be a decimal integer representing the number of bytes (of size specified by the byte size command) of storage to be reserved for the file. This command shall be followed by a store or append command. The ALLO command should be treated as a NO-OP (no operation) by those servers which do not require that the maximum size of the file be declared beforehand.
Restart (REST) - The argument field represents the server marker at which file transfer is to be restarted. This command does not cause file transfer but "spaces" over the file to the specified data checkpoint. This command shall be immediately followed by the appropriate FTP service command which shall cause file transfer to resume.
Rename from - (RNFR) - This command specifies the file which is to be renamed. This command must be immediately followed by a "rename to" command specifying the new file pathname.
Rename to (RNTO) - This command specifies the new pathname of the file specified in the immediately preceding "rename from" command. Together the two commands cause a file to be renamed.
Abort (ABOR) - This command indicates to the server to abort the previous FTP service command and any associated transfer of data. The abort command should be preceded by the TELNET SYNCH condition (indicated by the combination of the DATA MARK and the INS). No action is to be taken if the previous command has been completed (including data transfer). The TELNET connections are not to be closed by the server, but the data connection may be closed. An appropriate reply should be sent by the server.
Delete (DELE) - This command causes the file specified in the pathname to be deleted at the server site. If an extra level of protection is desired (such as the query, "Do you really wish to delete?"), it should be provided by the user-FTP process.
List (LIST) - This command causes a list to be sent from server to user site. If the pathname specifies a directory, the server should transfer a list of files in the specified directory. If the pathname specifies a file then server should send current information on the file. A null argument implies the user's current working or default directory. The data transfer is over the data connection in type ASCII or type EBCDIC. (It is the user's responsibility to ensure the correct parameters.)
NList (NLST) - This command causes a directory listing to be sent from server to user site. The pathname should specify a directory and the server will return a stream of names of files and no other information. The data will be transferred in ASCII or EBCDIC type over the data connection as valid pathname strings separated by CRLF. This command will allow automatic copying of an entire directory when used with the appropriate transfer commands.
Status (STAT) - This command shall cause a status response to be sent over the TELNET connection in form of a reply. The command may be sent during a file transfer (preceded by a TELNET SYNC) in which case the server will respond with the status of the operation in progress, or it may be sent between file transfers. In the latter case the command may have an argument field such as a pathname. If the argument is a pathname, the command is analogous to the "list" command except that data shall be transferred in ASCII on the TELNET connection. If a partial pathname is given, the server may respond with a list of file names or attributes associated with that specification. If no argument is given, the server should return general status information about the server FTP process. This should include current values of all transfer parameters and the status of connections.
Help (HELP) - This command shall cause the server to send helpful information regarding its implementation status over the TELNET connection to the user. The command may take an argument (e.g. any command name) and return more specific information as a response. The reply is type 100, general system status. It is suggested that HELP be allowed before entering a USER command.
Mail File (MLFL) - The intent of this command is to enable a 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 appended to the destination user's mail by the server in accordance with serving HOST mail conventions. The mail may be marked as sent from the particular using HOST and the user specified by the 'USER' command. The argument field may contain one or more system or NIC idents (it is recommended that multiple ident be allowed so the same mail can easily be sent to several users), 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 site mail. A NIC ident refers to the standard identification described in the NIC Directory of Network Participants. A serving host may keep a table mapping NIC indents into system idents, although NIC idents are not required in the implementation. A system ident is the user's normal identification at the serving host. The use of system idents would allow a network user to send mail to other users who do not have NIC identification but whose system ident is known.
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 one or more system or NIC idents, or it may be empty. The idents are 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" in a new line. It is suggested that a modest volume of mail service should be free; i.e., it may be entered before a USER command.
IV.A.4 Miscellaneous Commands
NoOP (NOOP) - This command does not affect any parameters or previously entered command. The server simply sends a no-op reply.
Quote (QUOT) - This command allows the user to talk directly to the FTP-server. After parsing this command, the user-FTP process will pass without examination all succeeding liners until the NQUO command is received. Between these two commands the server will respond appropriately to his implementation and the user's requests.
NoQuote (NQUO) - This command returns the user and server processes to normal interactive mode. Both QUOT and NQUO have reply codes to be sent by th server process to the user process to ensure agreement on the current mode.
The quote commands provide a convenient method of testing server-implemented experimental commands. The names of the latter should begin with an X, and can be listed in the system HELP reply. It should be noted that the official command set is expandable; suggestions should go first to Alexander A. McKenzie (BBN).