Network Working Group J. Postel Request for Comments: 959 J. Reynolds ISI Obsoletes RFC: 765 (IEN 149) October 1985 FILE TRANSFER PROTOCOL (FTP) ファイル転送プロトコル(FTP) 訳者より この文書はRFC959を自分のために翻訳したものです。 原文で述べられていることには、訳者(私)の英文読解能力、 コンピュータに関する知識を越えた部分があり、したがってこの文書 には誤解、誤訳が含まれている可能性があります。そのことを御承知 の上でこの文書を利用するようにしてください。 私が付けたコメントは MyComment = "(" ":訳注)" ; BNFにて:-) で書かれています。コメントには、私がその部分を訳しきれなかった ことを示すものもあります。そのような箇所(もちろんそうじゃない 部分も)の修正案を歓迎します。 また、文脈の上で特に強調する必要があると判断した語句については MyEmphasis = "*" "*" で強調しています。 日本語訳の配布条件は原文のそれに従いますが、上記のことに充分 注意してください。結局、ここにあるのは原文とは異なる物です。 山田 哲央 ivy@ma.kcom.ne.jp Status of this Memo This memo is the official specification of the File Transfer Protocol (FTP). Distribution of this memo is unlimited. このメモはファイル転送プロトコル(FTP)の公式な 仕様書である。このメモの配布は無制限である。 The following new optional commands are included in this edition of the specification: 今回の版には下の新しいオプションコマンドを含める: CDUP (Change to Parent Directory), SMNT (Structure Mount), STOU (Store Unique), RMD (Remove Directory), MKD (Make Directory), PWD (Print Directory), and SYST (System). CDUP(親ディレクトリに移動)、SMNT(構造のマウント)、 STOU(ユニークに保存)、RMD(ディレクトリの削除)、MKD (ディレクトリの作成)、PWD(ディレクトリの印刷)、SYST (システム) Note that this specification is compatible with the previous edition. この仕様は前回の版と互換性があることに注意してほしい。 1. INTRODUCTION The objectives of FTP are 1) to promote sharing of files (computer programs and/or data), 2) to encourage indirect or implicit (via programs) use of remote computers, 3) to shield a user from variations in file storage systems among hosts, and 4) to transfer data reliably and efficiently. FTP, though usable directly by a user at a terminal, is designed mainly for use by programs. FTPの目的は、1) ファイル(コンピュータプログラムやデータ) の共有を促進すること、2) 間接的または意識しない内に (プログラムを使っての)リモートコンピュータを使用すること を助けること、3) ホスト間のファイル保管システムの違いから ユーザを保護すること、そして 4) 信頼でき、効果的な形でデータ を転送することである。FTPは、ユーザが端末から直接使うこと もできるが、主にプログラムによる使用のためにデザインされている。 The attempt in this specification is to satisfy the diverse needs of users of maxi-hosts, mini-hosts, personal workstations, and TACs, with a simple, and easily implemented protocol design. この仕様書の試みは、シンプルで簡単に実装できるプロトコル デザインにより、大型ホスト、小型ホスト、パーソナルワーク ステーションやTACのユーザのさまざまな要求を満たすことである。 This paper assumes knowledge of the Transmission Control Protocol (TCP) [2] and the Telnet Protocol [3]. These documents are contained in the ARPA-Internet protocol handbook [1]. この論文はTCPプロトコル [2] とTelnetプロトコル [3] の知識を前提と している。これらの文書はARPA-Internet protocol handbook [1] に 含まれている。 2. OVERVIEW In this section, the history, the terminology, and the FTP model are discussed. The terms defined in this section are only those that have special significance in FTP. Some of the terminology is very specific to the FTP model; some readers may wish to turn to the section on the FTP model while reviewing the terminology. この章では、歴史、用語とFTPモデルについて議論する。この章で 定義されている用語は、FTPにおいて特別な意味を持つものだけで ある。いくつかの用語は、FTPモデルにかなり特化している;これら の用語に出会った時にFTPモデルの章に戻りたいと思う読者もいる かもしれない。 Postel & Reynolds [Page 1] RFC 959 October 1985 File Transfer Protocol 2.1. HISTORY FTP has had a long evolution over the years. Appendix III is a chronological compilation of Request for Comments documents relating to FTP. These include the first proposed file transfer mechanisms in 1971 that were developed for implementation on hosts at M.I.T. (RFC 114), plus comments and discussion in RFC 141. RFC 172 provided a user-level oriented protocol for file transfer between host computers (including terminal IMPs). A revision of this as RFC 265, restated FTP for additional review, while RFC 281 suggested further changes. The use of a "Set Data Type" transaction was proposed in RFC 294 in January 1982. RFC 354 obsoleted RFCs 264 and 265. The File Transfer Protocol was now defined as a protocol for file transfer between HOSTs on the ARPANET, with the primary function of FTP defined as transfering files efficiently and reliably among hosts and allowing the convenient use of remote file storage capabilities. RFC 385 further commented on errors, emphasis points, and additions to the protocol, while RFC 414 provided a status report on the working server and user FTPs. RFC 430, issued in 1973, (among other RFCs too numerous to mention) presented further comments on FTP. Finally, an "official" FTP document was published as RFC 454. By July 1973, considerable changes from the last versions of FTP were made, but the general structure remained the same. RFC 542 was published as a new "official" specification to reflect these changes. However, many implementations based on the older specification were not updated. In 1974, RFCs 607 and 614 continued comments on FTP. RFC 624 proposed further design changes and minor modifications. In 1975, RFC 686 entitled, "Leaving Well Enough Alone", discussed the differences between all of the early and later versions of FTP. RFC 691 presented a minor revision of RFC 686, regarding the subject of print files. Motivated by the transition from the NCP to the TCP as the underlying protocol, a phoenix was born out of all of the above efforts in RFC 765 as the specification of FTP for use on TCP. This current edition of the FTP specification is intended to correct some minor documentation errors, to improve the explanation of some protocol features, and to add some new optional commands. Postel & Reynolds [Page 2] RFC 959 October 1985 File Transfer Protocol In particular, the following new optional commands are included in this edition of the specification: 特に、下の新しいオプションコマンドが仕様の今回の版に含められる: CDUP - Change to Parent Directory SMNT - Structure Mount STOU - Store Unique RMD - Remove Directory MKD - Make Directory PWD - Print Directory SYST - System This specification is compatible with the previous edition. A program implemented in conformance to the previous specification should automatically be in conformance to this specification. この仕様は前回の版と互換性がある。前回の仕様に従って実装 されたプログラムは、今回の仕様に自然と従っているべきであろう。 2.2. TERMINOLOGY 2.2. 用語 ASCII The ASCII character set is as defined in the ARPA-Internet Protocol Handbook. In FTP, ASCII characters are defined to be the lower half of an eight-bit code set (i.e., the most significant bit is zero). ASCII文字セットはARPA-Internet Protocol Handbookで定義された ような物である。FTPでは、ASCII文字は8ビットコードセットの 前半(つまり、最上位ビットが0)であると定義する。 access controls アクセス制御 Access controls define users' access privileges to the use of a system, and to the files in that system. Access controls are necessary to prevent unauthorized or accidental use of files. It is the prerogative of a server-FTP process to invoke access controls. アクセス制御はユーザの、システムの使用とそのシステム上の ファイルへのアクセス権を制限する。アクセス制御は、無権限 または偶発的なファイルの使用を防ぐために必要である。 サーバ側FTPプロセスだけがアクセス制御を行う権利を持つ。 byte size There are two byte sizes of interest in FTP: the logical byte size of the file, and the transfer byte size used for the transmission of the data. The transfer byte size is always 8 bits. The transfer byte size is not necessarily the byte size in which data is to be stored in a system, nor the logical byte size for interpretation of the structure of the data. FTPでは、対象となる2つのバイトサイズがある:ファイルの 論理バイトサイズとデータの転送に使われる転送バイトサイズ である。転送バイトサイズは常に8ビットである。転送バイト サイズが、システムにデータを保存するときのバイトサイズや データの構造を解釈するための論理バイトサイズである必要 はない。 Postel & Reynolds [Page 3] RFC 959 October 1985 File Transfer Protocol control connection 制御接続 The communication path between the USER-PI and SERVER-PI for the exchange of commands and replies. This connection follows the Telnet Protocol. コマンドと返答のやり取りのための、ユーザ側PIとサーバ側PIの 間のコミュニケーション路。この接続はTelnetプロトコルに従う。 data connection データ接続 A full duplex connection over which data is transferred, in a specified mode and type. The data transferred may be a part of a file, an entire file or a number of files. The path may be between a server-DTP and a user-DTP, or between two server-DTPs. データを指定したモードとタイプで転送するための全二重の接続。 転送されるデータは、ファイルの一部分でもよいし1つのファイル 全体や複数のファイルでもよい。この経路はサーバ側DTPとユーザ 側DTP間にあってもよいし、2つの(異なる:訳注)サーバ側DTP間 にあってもよい。 data port The passive data transfer process "listens" on the data port for a connection from the active transfer process in order to open the data connection. 受動的なDTPはデータ接続を開くために、データポート上で 能動的なDTPからの接続に「聞き耳をたてる」。 DTP The data transfer process establishes and manages the data connection. The DTP can be passive or active. データ転送プロセス(data transfer process, i.e. DTP:訳注) は、データ接続を構築し管理する。DTPは能動的にも受動的 にも成り得る。 End-of-Line 行末(EOL:訳注) The end-of-line sequence defines the separation of printing lines. The sequence is Carriage Return, followed by Line Feed. 行の終わりの綴りが印刷する行の分かれ目を定義する。綴りは、 キャリッジリターン(CR)とそれに続くラインフィード(LF)である。 EOF The end-of-file condition that defines the end of a file being transferred. ファイル末の状況は、転送されているファイルの末尾を定義する。 EOR The end-of-record condition that defines the end of a record being transferred. レコード末の状況は、転送されているレコードの末尾を定義する。 error recovery エラー回復 A procedure that allows a user to recover from certain errors such as failure of either host system or transfer process. In FTP, error recovery may involve restarting a file transfer at a given checkpoint. ホストシステムや転送プロセスの失敗などある種のエラーから、 ユーザが回復するのを可能にする手続き。FTPでのエラー回復は、 与えられたチェックポイントからファイルの転送を再開すること を含むだろう。 Postel & Reynolds [Page 4] RFC 959 October 1985 File Transfer Protocol FTP commands A set of commands that comprise the control information flowing from the user-FTP to the server-FTP process. ユーザ側FTPプロセスからサーバ側FTPプロセスに流れる制御情報 から成るコマンドの集合。 file An ordered set of computer data (including programs), of arbitrary length, uniquely identified by a pathname. 任意の長さを持ち、パス名により固有に識別される (プログラムを含む)コンピュータデータの順序付きの 集合。 mode モード The mode in which data is to be transferred via the data connection. The mode defines the data format during transfer including EOR and EOF. The transfer modes defined in FTP are described in the Section on Transmission Modes. データは、何らかのモードで、データ接続を通して転送される。 モードは、転送中のデータの、EORやEOFを含むフォーマットを 定義する。FTPで定義されている転送モードはTransmission Modes の章で述べられている。 NVT The Network Virtual Terminal as defined in the Telnet Protocol. Telnetプロトコルで定義されているようなネットワーク仮想端末。 NVFS The Network Virtual File System. A concept which defines a standard network file system with standard commands and pathname conventions. ネットワーク仮想ファイルシステム。標準的なコマンドとパス名 の慣習を持つ標準的なネットワークファイルシステムを定義する 概念。 page A file may be structured as a set of independent parts called pages. FTP supports the transmission of discontinuous files as independent indexed pages. あるファイルはページと呼ばれる独立した部分の集合として 構造化されているかもしれない。FTPは不連続なファイルの転送を、 独立の、索引付きのページとしてサポートする。 pathname Pathname is defined to be the character string which must be input to a file system by a user in order to identify a file. Pathname normally contains device and/or directory names, and file name specification. FTP does not yet specify a standard pathname convention. Each user must follow the file naming conventions of the file systems involved in the transfer. パス名は、ファイルを識別するためにユーザがファイルシステムに 対して入力しなければならない文字列として定義される。パス名は 普通、デバイスやディレクトリ名とファイル名の特定を含む。 FTPはまだ標準的なパス名のしきたりを指定していない。個々の ユーザは、転送に関連したファイルシステムのファイルの名付け方に 従わなければならない。 PI The protocol interpreter. The user and server sides of the protocol have distinct roles implemented in a user-PI and a server-PI. プロトコル解釈部。プロトコルのユーザ側、サーバ側は ユーザ側PIとサーバ側PIで実装された異なる役目を果たす。 Postel & Reynolds [Page 5] RFC 959 October 1985 File Transfer Protocol record A sequential file may be structured as a number of contiguous parts called records. Record structures are supported by FTP but a file need not have record structure. (中味の:訳注)連続したファイルは、レコードと呼ばれる いくつもの連続した部分として構造化されているかもしれない。 レコード構造はFTPでサポートされるが、ファイルがレコード 構造を持つ必要はない。 reply 返答 A reply is an acknowledgment (positive or negative) sent from server to user via the control connection in response to FTP commands. The general form of a reply is a completion code (including error codes) followed by a text string. The codes are for use by programs and the text is usually intended for human users. 返答とは、FTPコマンドに応じて制御接続を介してサーバから ユーザに送られる、(肯定的、あるいは否定的な)受け取り通知 である。返答の一般的な形式は、(エラーコードを含む)完了 コードとそれに続く文である。コードはプログラムによる使用 のため、文は普通人間のユーザのためのものである。 server-DTP サーバ側DTP The data transfer process, in its normal "active" state, establishes the data connection with the "listening" data port. It sets up parameters for transfer and storage, and transfers data on command from its PI. The DTP can be placed in a "passive" state to listen for, rather than initiate a connection on the data port. DTPは、それが普通の「能動」状態の時では、「聞き耳を たてている」データポートとのデータ接続を構築する。 それは転送のためのパラメータとストレージを設置し、そのPIからの 命令に従ってデータを転送する。DTPは、データポートで接続に 着手するよりもむしろ聞き手にまわるための、「受動」状態に あることが出来る。 server-FTP process サーバ側FTPプロセス A process or set of processes which perform the function of file transfer in cooperation with a user-FTP process and, possibly, another server. The functions consist of a protocol interpreter (PI) and a data transfer process (DTP). ユーザ側FTPプロセスや、可能なら他のサーバと連携して ファイル転送の機能を実現するプロセス、またはその集合。 機能は、プロトコル解釈部(PI)とデータ転送プロセス(DTP)から成る。 server-PI サーバ側PI The server protocol interpreter "listens" on Port L for a connection from a user-PI and establishes a control communication connection. It receives standard FTP commands from the user-PI, sends replies, and governs the server-DTP. サーバ側PIは、ポートLでユーザ側PIからの接続に「聞き耳を立て」、 制御コミュニケーションの接続を構築する。また、ユーザ側PIからの 標準的なFTPコマンドを受け取り、返答を送り、サーバ側DTPを管理する。 type タイプ The data representation type used for data transfer and storage. Type implies certain transformations between the time of data storage and data transfer. The representation types defined in FTP are described in the Section on Establishing Data Connections. データの転送と保管のために使われる、データを表現するタイプ。 タイプは、データ保管の時とデータ転送の時の間にある、ある種の 変換をほのめかしている。FTPで定義されている表現タイプは Establishing Data Connectionsの章で述べられている。 Postel & Reynolds [Page 6] RFC 959 October 1985 File Transfer Protocol user A person or a process on behalf of a person wishing to obtain file transfer service. The human user may interact directly with a server-FTP process, but use of a user-FTP process is preferred since the protocol design is weighted towards automata. 人間、またはファイル転送のサービスを得たいと思っている人間 に代わるプロセス。人間のユーザはサーバ側FTPプロセスに直接 作用してもよいが、プロトコルのデザインが機械に重点を置いて いるので、ユーザ側FTPプロセスの使用が望ましい。 user-DTP ユーザ側DTP The data transfer process "listens" on the data port for a connection from a server-FTP process. If two servers are transferring data between them, the user-DTP is inactive. このデータ転送プロセスは、データポート上でサーバ側FTP プロセスからの接続に「聞き耳を立てる」。もし2つの サーバがその間でデータを転送している場合、ユーザ側DTP は活動しない。 user-FTP process ユーザ側FTPプロセス A set of functions including a protocol interpreter, a data transfer process and a user interface which together perform the function of file transfer in cooperation with one or more server-FTP processes. The user interface allows a local language to be used in the command-reply dialogue with the user. プロトコル解析部、データ転送プロセスと、1つまたは複数の サーバ側FTPプロセスと協力してファイル転送の機能を実現する ユーザインターフェイスを含む機能の集合体。 ユーザインターフェイスは、ユーザとのコマンドとその返答の 対話においてローカルな言語(つまり日本語とか:訳注)が使用 されることを可能にする。 user-PI ユーザ側PI The user protocol interpreter initiates the control connection from its port U to the server-FTP process, initiates FTP commands, and governs the user-DTP if that process is part of the file transfer. ユーザ側のプロトコル解析部(i.e. ユーザ側PI:訳注)は、ポートU からサーバ側FTPプロセスへの制御接続に着手し、FTPコマンドを 作り、もしその処理がファイル転送の一部なら、ユーザ側DTPを管理する。 Postel & Reynolds [Page 7] RFC 959 October 1985 File Transfer Protocol 2.3. THE FTP MODEL With the above definitions in mind, the following model (shown in Figure 1) may be diagrammed for an FTP service. 上の定義を考慮に入れた上で、FTPサービスは下のモデル (図1)のように図示される。 ------------- |/---------\| || User || -------- ||Interface|<--->| User | |\----^----/| -------- ---------- | | | |/------\| FTP Commands |/----V----\| ||Server|<---------------->| User || || PI || FTP Replies || PI || |\--^---/| |\----^----/| | | | | | | -------- |/--V---\| Data |/----V----\| -------- | File |<--->|Server|<---------------->| User |<--->| File | |System| || DTP || Connection || DTP || |System| -------- |\------/| |\---------/| -------- ---------- ------------- Server-FTP USER-FTP NOTES: 1. The data connection may be used in either direction. 2. The data connection need not exist all of the time. 備考:1 データ接続はどちらの向きで使用されてもかまわない。 2 データ接続はいつでも存在しなければならないわけではない。 Figure 1 Model for FTP Use In the model described in Figure 1, the user-protocol interpreter initiates the control connection. The control connection follows the Telnet protocol. At the initiation of the user, standard FTP commands are generated by the user-PI and transmitted to the server process via the control connection. (The user may establish a direct control connection to the server-FTP, from a TAC terminal for example, and generate standard FTP commands independently, bypassing the user-FTP process.) Standard replies are sent from the server-PI to the user-PI over the control connection in response to the commands. 図1に示されたモデルでは、ユーザ側PIが制御接続に着手する。 制御接続はTelnetプロトコルに従う。ユーザが使用開始した時に、 標準的なFTPコマンドがユーザ側PIによって生成され、制御接続を 介してサーバプロセスに転送される。(ユーザは、例えばTAC端末 から、サーバ側FTPに向けて直接の制御接続を作り、ユーザ側FTP プロセスを迂回して標準的なFTPコマンドを生成するかもしれない。) 標準的な返答は、コマンドに応じてサーバ側PIからユーザ側PIに 制御接続を介して送られる。 The FTP commands specify the parameters for the data connection (data port, transfer mode, representation type, and structure) and the nature of file system operation (store, retrieve, append, delete, etc.). The user-DTP or its designate should "listen" on the specified data port, and the server initiate the data connection and data transfer in accordance with the specified parameters. It should be noted that the data port need not be in Postel & Reynolds [Page 8] RFC 959 October 1985 File Transfer Protocol the same host that initiates the FTP commands via the control connection, but the user or the user-FTP process must ensure a "listen" on the specified data port. It ought to also be noted that the data connection may be used for simultaneous sending and receiving. FTPコマンドは、データ接続のパラメータ(データポート、転送 モード、表現タイプと構造)とファイルシステム操作の種類 (保存、確保、付け足し、削除など)を指定する。ユーザ側DTP またはそれが指名したものは、指定されたデータポートで「聞き耳 を立て」、サーバ(側DTP:訳注)はデータ接続を確立し指定 されたパラメータに従ってデータの転送を開始する。データポート が、制御接続を経由してFTPコマンドに着手したホストと同じものに 属している必要はないが、ユーザまたはユーザ側FTPプロセスは、 指定されたデータポートで確実に「聞き耳を立てて」いなければ ならないことに注意しなければならない。データ接続が送受信両方 のために同時に使われるかもしれないことにも注意するべきである。 In another situation a user might wish to transfer files between two hosts, neither of which is a local host. The user sets up control connections to the two servers and then arranges for a data connection between them. In this manner, control information is passed to the user-PI but data is transferred between the server data transfer processes. Following is a model of this server-server interaction. ユーザが、どちらもローカルホストでない2つのホスト間でファイル を転送しようとするような状況もあり得る。ユーザはその2つの サーバに制御接続を設置し、それからそれらの間にデータ接続を 手配する。このように、制御の情報はユーザ側PIに渡されるが、 データはサーバ側DTPの間で転送される。下はこのサーバからサーバ への相互作用のモデルである。 Control ------------ Control ---------->| User-FTP |<----------- | | User-PI | | | | "C" | | V ------------ V -------------- -------------- | Server-FTP | Data Connection | Server-FTP | | "A" |<---------------------->| "B" | -------------- Port (A) Port (B) -------------- Figure 2 The protocol requires that the control connections be open while data transfer is in progress. It is the responsibility of the user to request the closing of the control connections when finished using the FTP service, while it is the server who takes the action. The server may abort data transfer if the control connections are closed without command. このプロトコルは、データの転送が進行中の間、制御接続が開いた ままでいることを要求する。FTPサービスの使用を終えた時に 制御接続の切断を要求するのはユーザの責任である、行動を取る のはサーバではあるが。命令なしに制御接続が閉じた場合、サーバ はデータの転送を中断してもよい。 The Relationship between FTP and Telnet: The FTP uses the Telnet protocol on the control connection. This can be achieved in two ways: first, the user-PI or the server-PI may implement the rules of the Telnet Protocol directly in their own procedures; or, second, the user-PI or the server-PI may make use of the existing Telnet module in the system. FTPは制御接続でTelnetプロトコルを使う。これは2つの方法で 成し遂げることができる:まず、ユーザ側PIやサーバ側PIは自身 の手続きにおいて、直接Telnetプロトコルのルールを実装する; または、ユーザ側PIやサーバ側PIはシステムにある既存のTelnet モジュールを使用する。 Ease of implementaion, sharing code, and modular programming argue for the second approach. Efficiency and independence Postel & Reynolds [Page 9] RFC 959 October 1985 File Transfer Protocol argue for the first approach. In practice, FTP relies on very little of the Telnet Protocol, so the first approach does not necessarily involve a large amount of code. 実装の簡便さ、コードの共有やモジュールプログラミングを 考えると二番目の方法になる。効率と独立性を考えると最初の 方法になる。実際には、FTPはTelnetプロトコルにほとんど 依存していないので、最初の方法が必ずしも大量のコードを 巻き添えにするというわけではない。 3. DATA TRANSFER FUNCTIONS Files are transferred only via the data connection. The control connection is used for the transfer of commands, which describe the functions to be performed, and the replies to these commands (see the Section on FTP Replies). Several commands are concerned with the transfer of data between hosts. These data transfer commands include the MODE command which specify how the bits of the data are to be transmitted, and the STRUcture and TYPE commands, which are used to define the way in which the data are to be represented. The transmission and representation are basically independent but the "Stream" transmission mode is dependent on the file structure attribute and if "Compressed" transmission mode is used, the nature of the filler byte depends on the representation type. ファイルはデータ接続を介してのみ転送される。制御接続は、実行される べき機能を述べるコマンドと、これらのコマンドの返答(FTP Repliesの章 を参照のこと)の転送のために使われる。いくつかのコマンドはホスト間 でのデータの転送に関係している。これらのデータ転送コマンドは、データ のビットがどのように伝送されるかを指定するMODEコマンドや、データが 表現されるべき方法を定義するために使われるSTRU、TYPEコマンドを含む。 伝送と表現は基本的に(互いに:訳注)独立しているが、「ストリーム」 伝送モードはファイル構造の属性に依存しているし、「圧縮」伝送モード が使われる場合は、詰め物バイトの性質が表現タイプに依存する。 3.1. DATA REPRESENTATION AND STORAGE Data is transferred from a storage device in the sending host to a storage device in the receiving host. Often it is necessary to perform certain transformations on the data because data storage representations in the two systems are different. For example, NVT-ASCII has different data storage representations in different systems. DEC TOPS-20s's generally store NVT-ASCII as five 7-bit ASCII characters, left-justified in a 36-bit word. IBM Mainframe's store NVT-ASCII as 8-bit EBCDIC codes. Multics stores NVT-ASCII as four 9-bit characters in a 36-bit word. It is desirable to convert characters into the standard NVT-ASCII representation when transmitting text between dissimilar systems. The sending and receiving sites would have to perform the necessary transformations between the standard representation and their internal representations. データは、それを送っているホストのストレージデバイスから、 それを受け取るホストのストレージデバイスに転送される。2つの システムでのデータストレージの表現は異なっているので、データ にある種の変換を行う必要があることがしばしばある。例えば、 NVT-ASCIIは異なるシステムごとに異なるデータストレージ表現を 持っている。DECのTOPS-20sは一般的にNVT-ASCIIを5つの7ビット ASCII文字として、36ビットワードを左詰めして保存する。IBMの メインフレームはNVT-ASCIIを8ビットのEBCDICコードで保存する。 MulticsはNVT-ASCIIを4つの9ビット文字として36ビットワードで 保存する。異なるシステム間で文章を伝達する時には、文字を標準 NVT-ASCII表現に変換することが望ましい。送信側も受信側も、標準 表現とそれぞれの内部表現の間の必要な変換を実行しなければ ならないだろう。 A different problem in representation arises when transmitting binary data (not character codes) between host systems with different word lengths. It is not always clear how the sender should send data, and the receiver store it. For example, when transmitting 32-bit bytes from a 32-bit word-length system to a 36-bit word-length system, it may be desirable (for reasons of efficiency and usefulness) to store the 32-bit bytes right-justified in a 36-bit word in the latter system. In any case, the user should have the option of specifying data representation and transformation functions. It should be noted Postel & Reynolds [Page 10] RFC 959 October 1985 File Transfer Protocol that FTP provides for very limited data type representations. Transformations desired beyond this limited capability should be performed by the user directly. 異なるワードサイズ(word lengths:訳注)を持つホストシステム 間でのバイナリデータ(文字コードではない)を転送する時には、 表現に関してのもう1つの問題が生じる。送信側がどのように データを送るべきで、受取側がそれをどのよう保存するべきなのか がいつでも明らかなわけではない。例えば、ワードサイズが32 ビットのシステムから36ビットのシステムに32ビットのバイト を転送する時、(効率と有用性の観点から)後者では36ビット ワードの中に32ビットのバイトを右詰めで保存するのが望ましい だろう。どんな場合においても、ユーザはデータ表現と変換機能を 指定できるオプションを持っているべきである。FTPは非常に制限 されたデータタイプ表現のために準備されていることに注意する べきである。この制限された範囲を越えて要求される変換は、直接 ユーザによって行われるべきである。 3.1.1. DATA TYPES Data representations are handled in FTP by a user specifying a representation type. This type may implicitly (as in ASCII or EBCDIC) or explicitly (as in Local byte) define a byte size for interpretation which is referred to as the "logical byte size." Note that this has nothing to do with the byte size used for transmission over the data connection, called the "transfer byte size", and the two should not be confused. For example, NVT-ASCII has a logical byte size of 8 bits. If the type is Local byte, then the TYPE command has an obligatory second parameter specifying the logical byte size. The transfer byte size is always 8 bits. データ表現は、 FTPでは、ユーザが表現タイプを指定すること で処理される。このタイプは、「論理バイトサイズ」と言われる 解釈時のバイトサイズを、(ASCIIやEBCDICの場合のように) 暗にあるいは(ローカルバイトの場合のように)明示的に定義 するだろう。これは、「転送バイトサイズ」と呼ばれる、データ 接続を経ての伝送のために使われるバイトサイズとは関係がなく、 この2つを勘違いしないように注意しなければならない。例えば、 NVT-ASCIIの論理バイトサイズは8ビットである。もしそのタイプ がローカルバイトなら、TYPEコマンドは論理バイトサイズを指定 する第2パラメータを必要とする。転送バイトサイズは常に 8ビットである。 3.1.1.1. ASCII TYPE This is the default type and must be accepted by all FTP implementations. It is intended primarily for the transfer of text files, except when both hosts would find the EBCDIC type more convenient. これはデフォルトのタイプであり、全てのFTPの実装で使用 可能でなければならない。送受信両方のホストがEBCDICが より便利であると判断した場合を除けば、これは主として テキストファイルの転送のためのものである。 The sender converts the data from an internal character representation to the standard 8-bit NVT-ASCII representation (see the Telnet specification). The receiver will convert the data from the standard form to his own internal form. 送信側はデータを内部の文字表現から標準の8ビット NVT-ASCII表現(Telnetの仕様を参照のこと)に変換する。 受取側は、標準の表現から独自の表現にデータを変換するだろう。 In accordance with the NVT standard, the sequence should be used where necessary to denote the end of a line of text. (See the discussion of file structure at the end of the Section on Data Representation and Storage.) NVTの標準に従って、の綴りが文章における行の最後 を意味するのに必要な場所に使われるべきである。(データ表現 とストレージの章の最後にあるファイル構造の説明を参照のこと) Using the standard NVT-ASCII representation means that data must be interpreted as 8-bit bytes. 標準のNVT-ASCII表現を使うことは、データが8ビットのバイト であると解釈されなければならないことを意味する。 The Format parameter for ASCII and EBCDIC types is discussed below. ASCIIタイプとEBCDICタイプのFormatパラメータについては 下で説明する。 Postel & Reynolds [Page 11] RFC 959 October 1985 File Transfer Protocol 3.1.1.2. EBCDIC TYPE This type is intended for efficient transfer between hosts which use EBCDIC for their internal character representation. このタイプは、内部の文字表現にEBCDICを使っている ホスト同士での効果的な転送のためのものである。 For transmission, the data are represented as 8-bit EBCDIC characters. The character code is the only difference between the functional specifications of EBCDIC and ASCII types. 転送ではデータは8ビットのEBCDIC文字として表現される。 EBCDICタイプとASCIIタイプの機能の違いは、文字コードの 違いだけである。 End-of-line (as opposed to end-of-record--see the discussion of structure) will probably be rarely used with EBCDIC type for purposes of denoting structure, but where it is necessary the character should be used. (レコード末とは対照的にーー構造の説明を参照のこと)行末 は、EBCDICタイプでは、構造を示すことを目的として使われる ことはあまりないだろうが、必要な場所ではが使われる べきである。 3.1.1.3. IMAGE TYPE The data are sent as contiguous bits which, for transfer, are packed into the 8-bit transfer bytes. The receiving site must store the data as contiguous bits. The structure of the storage system might necessitate the padding of the file (or of each record, for a record-structured file) to some convenient boundary (byte, word or block). This padding, which must be all zeros, may occur only at the end of the file (or at the end of each record) and there must be a way of identifying the padding bits so that they may be stripped off if the file is retrieved. The padding transformation should be well publicized to enable a user to process a file at the storage site. データは、転送では、8ビットの転送バイトに詰め込まれた 連続したビットとして送られる。受取側はデータを連続した ビットとして保存しなければならない。ストレージシステムの 構造は、何らかの適当な境界(バイト、ワードやブロック)で ファイル(あるいはレコード構造のファイルでは、レコード毎の) の詰め物を必要とするかもしれない。この詰め物、これは全て 0でなければならない、はファイルの末尾(あるいは各レコード の末尾)でのみ現れなければならず、ファイルが確保(get:訳注) される場合に取り除かれてもいいように、詰め物となるビット を特定できる方法がなければならない。詰め物の変換方法は、 ユーザが保存側のファイルを処理するのを可能にするため、 充分に公表されているべきである。 Image type is intended for the efficient storage and retrieval of files and for the transfer of binary data. It is recommended that this type be accepted by all FTP implementations. イメージタイプは、ファイルの効果的な保存(put:訳注) と確保(get:訳注)と、バイナリデータの転送のための ものである。このタイプは全てのFTP実装において使用 出来ることが推奨される。 3.1.1.4. LOCAL TYPE The data is transferred in logical bytes of the size specified by the obligatory second parameter, Byte size. The value of Byte size must be a decimal integer; there is no default value. The logical byte size is not necessarily the same as the transfer byte size. If there is a difference in byte sizes, then the logical bytes should be packed contiguously, disregarding transfer byte boundaries and with any necessary padding at the end. データは、必須である2番目のパラメータであるByteで 指定されたサイズの論理バイトで転送される。Byteの値 は10進数整数でなければならない;これにはデフォルト 値はない。この論理バイトサイズは、転送バイトサイズと 同じである必要はない。バイトサイズに違いがある場合、 論理バイトは転送バイトの境界を考慮に入れずに連続して 詰められ、最後には何らかの必要な詰め物をする。 Postel & Reynolds [Page 12] RFC 959 October 1985 File Transfer Protocol When the data reaches the receiving host, it will be transformed in a manner dependent on the logical byte size and the particular host. This transformation must be invertible (i.e., an identical file can be retrieved if the same parameters are used) and should be well publicized by the FTP implementors. データが受取側ホストに到着した時、それは論理バイトサイズ と特定のホストに依存する方法で変換されるだろう。この変換 は逆にできなければならず(つまり、同じパラメータが使われた 時には、同等のファイルを得ることができる)、FTPの実装者 (FTPソフトの開発者:訳注)はこれを充分に公表しなければ ならない。 For example, a user sending 36-bit floating-point numbers to a host with a 32-bit word could send that data as Local byte with a logical byte size of 36. The receiving host would then be expected to store the logical bytes so that they could be easily manipulated; in this example putting the 36-bit logical bytes into 64-bit double words should suffice. 例えば、36ビットの浮動小数点数を32ビットワードの ホストに送信するユーザは、論理バイトサイズを36にする ことでこのデータをLocalバイトとして送信できるだろう。 そして受取側のホストは、論理バイトを、それらが容易に 操作できるように保存することが望まれる;この例では、 36ビット論理バイトを64ビットのダブルワードに蓄積 すれば充分である。 In another example, a pair of hosts with a 36-bit word size may send data to one another in words by using TYPE L 36. The data would be sent in the 8-bit transmission bytes packed so that 9 transmission bytes carried two host words. もう1つの例では、両サイトとも36ビットワードサイズなら、 TYPE L 36を使ったワードでお互いにデータを送れるだろう。 データは、9つの転送バイトで2つのホストワードを運べる ように、8ビット伝送バイトに詰め込まれて送られるだろう。 3.1.1.5. FORMAT CONTROL 3.1.1.5. 書式制御 The types ASCII and EBCDIC also take a second (optional) parameter; this is to indicate what kind of vertical format control, if any, is associated with a file. The following data representation types are defined in FTP: ASCIIタイプとEBCDICタイプも(オプションで)2番目の パラメータを取ることができる;これは、どの種類の縦の 書式制御がファイルと関連しているかを指示するためのもの である。下記のデータ表現タイプがFTPで定義されている: A character file may be transferred to a host for one of three purposes: for printing, for storage and later retrieval, or for processing. If a file is sent for printing, the receiving host must know how the vertical format control is represented. In the second case, it must be possible to store a file at a host and then retrieve it later in exactly the same form. Finally, it should be possible to move a file from one host to another and process the file at the second host without undue trouble. A single ASCII or EBCDIC format does not satisfy all these conditions. Therefore, these types have a second parameter specifying one of the following three formats: 文字のファイルは、3つの目的のうちのどれかのためにホスト に転送されるかもしれない:プリントのため、保存して後で 取り戻すため、または処理のため。もしファイルがプリント のために送られるなら、受取側ホストは縦の書式制御が どのように表現されているかを知らなければならない。2番目 の場合、ホストでファイルを保持し後でまったく同じ形で 取り戻せなくてはならない。最後のは、あるホストからもう 1つのホストへファイルを移動し、不当なトラブル無しに 2番目のホストでファイルを処理できるべきである。単一の ASCIIやEBCDICの書式では、これら全ての状況には対応でき ない。したがって、これらのタイプは以下の3つの書式を指定 するための2番目のパラメータを持つのである。 3.1.1.5.1. NON PRINT This is the default format to be used if the second (format) parameter is omitted. Non-print format must be accepted by all FTP implementations. これは2番目の(書式の)パラメータが省略された時に 使われるデフォルトの書式である。Non-print書式はすべて のFTP実装において使用可能でなければならない。 Postel & Reynolds [Page 13] RFC 959 October 1985 File Transfer Protocol The file need contain no vertical format information. If it is passed to a printer process, this process may assume standard values for spacing and margins. ファイルは縦の書式情報を含んでいなくてもよい。これが 印刷するプロセスに与えられた場合、このプロセスは空白 と余白に標準的な値を仮定してもかまわない。 Normally, this format will be used with files destined for processing or just storage. 普通、この書式は処理あるいは単に保存する予定のファイル で使われるだろう。 3.1.1.5.2. TELNET FORMAT CONTROLS The file contains ASCII/EBCDIC vertical format controls (i.e., , , , , ) which the printer process will interpret appropriately. , in exactly this sequence, also denotes end-of-line. ファイルがASCIIあるいはEBCDICの縦の書式制御(つまり、 , , , , )を含み、これは印刷する プロセスに適当に解釈される。も、正確にこの綴り で、行末を意味する。 3.1.1.5.2. CARRIAGE CONTROL (ASA) The file contains ASA (FORTRAN) vertical format control characters. (See RFC 740 Appendix C; and Communications of the ACM, Vol. 7, No. 10, p. 606, October 1964.) In a line or a record formatted according to the ASA Standard, the first character is not to be printed. Instead, it should be used to determine the vertical movement of the paper which should take place before the rest of the record is printed. ファイルがASA(FORTRAN)の縦の書式制御文字を含む。 (RFC 740の付録C;とCommunications of the ACMのVol.7, No. 10, p. 606, October 1964を見よ)ASAの標準に従って 書式化された行、あるいはレコードでは、最初の文字は印刷 されない。そのかわり、レコードの残りが印刷される前に 行われる紙の縦送りを決定するために使われるべきである。 The ASA Standard specifies the following control characters: ASA標準は以下の制御文字を指定している: Character Vertical Spacing 文字 縦の空白 blank Move paper up one line 1行紙送り 0 Move paper up two lines 2行紙送り 1 Move paper to top of next page 次のページの頭まで紙送り + No movement, i.e., overprint 動かない、つまり、上書き Clearly there must be some way for a printer process to distinguish the end of the structural entity. If a file has record structure (see below) this is no problem; records will be explicitly marked during transfer and storage. If the file has no record structure, the end-of-line sequence is used to separate printing lines, but these format effectors are overridden by the ASA controls. 明らかに、印刷するプロセスが構造的な実体の終末を判別する 何らかの方法がなければならない。もしファイルがレコード 構造を持つなら(後述)、これは問題ない;レコードは、転送 と保存の間じゅう、はっきりと印が付けられているだろう。 もしファイルがレコード構造を持たないのであれば、 の行末綴りが印刷される行を分割するのに使われるが、これら の書式の効果はASA制御に上塗りされる。 Postel & Reynolds [Page 14] RFC 959 October 1985 File Transfer Protocol 3.1.2. DATA STRUCTURES 3.1.2. データ構造 In addition to different representation types, FTP allows the structure of a file to be specified. Three file structures are defined in FTP: 様々な表現タイプに加え、FTPはファイル構造が指定される のを許可する。3つのファイル構造がFTPで定義されている: file-structure, where there is no internal structure and the file is considered to be a continuous sequence of data bytes, ファイル構造、内部構造が無く、ファイルはデータバイト の一連の連続であると考えられる record-structure, where the file is made up of sequential records, レコード構造、ファイルが連続したレコードで出来ている and page-structure, where the file is made up of independent indexed pages. ページ構造、ファイルは独立した索引つきのページで 構成されている File-structure is the default to be assumed if the STRUcture command has not been used but both file and record structures must be accepted for "text" files (i.e., files with TYPE ASCII or EBCDIC) by all FTP implementations. The structure of a file will affect both the transfer mode of a file (see the Section on Transmission Modes) and the interpretation and storage of the file. ファイル構造は、STRUコマンドが使われなかった場合に想定 されるデフォルトであるが、全てのFTP実装において、ファイル 構造とレコード構造の両方とも、「テキスト」ファイル(つまり、 TYPE ASCIIあるいはTYPE EBCDICのファイル)を受け付けな ければならない。ファイルの構造は、ファイルの転送モード (伝送モードの章を参照のこと)と、ファイルの解釈と保存 の両方に影響を及ぼすだろう。 The "natural" structure of a file will depend on which host stores the file. A source-code file will usually be stored on an IBM Mainframe in fixed length records but on a DEC TOPS-20 as a stream of characters partitioned into lines, for example by . If the transfer of files between such disparate sites is to be useful, there must be some way for one site to recognize the other's assumptions about the file. ファイルの「自然な」構造は、どのホストがファイルを保存するか に依存する。ソースコードのファイルは普通、IBMのメインフレーム では固定長レコードで、DECのTOPS-20ではなどで行に区切 られた文字の連続として保存されるだろう。もしこのような共通点 のないサイト間でのファイル転送を有用にするのであれば、一方が もう一方のファイルの前提を理解できる何らかの方法がなければならない。 With some sites being naturally file-oriented and others naturally record-oriented there may be problems if a file with one structure is sent to a host oriented to the other. If a text file is sent with record-structure to a host which is file oriented, then that host should apply an internal transformation to the file based on the record structure. Obviously, this transformation should be useful, but it must also be invertible so that an identical file may be retrieved using record structure. ファイルを標準としているサイトとレコードを標準としている サイトがあるため、1つの構造を持つファイルが他のものを標準 としているホストに送られる場合に問題が生じる。もしテキスト ファイルがレコード構造で、ファイル構造指向のホストに送ら れるなら、そのホスト(受取側:訳注)は内部的な変換をレコード 構造に基づいたファイルに適用すべきである。明らかにこの変換は 有用であるべきだが、レコード構造を使って同一のファイルを確保 できるように、その変換は可逆でなければならない。 In the case of a file being sent with file-structure to a record-oriented host, there exists the question of what criteria the host should use to divide the file into records which can be processed locally. If this division is necessary, the FTP implementation should use the end-of-line sequence, Postel & Reynolds [Page 15] RFC 959 October 1985 File Transfer Protocol for ASCII, or for EBCDIC text files, as the delimiter. If an FTP implementation adopts this technique, it must be prepared to reverse the transformation if the file is retrieved with file-structure. ファイルがファイル構造でレコード構造指向のホストに 送られる場合、そのホストがローカルで処理できるレコード にファイルを分割するのに使うべきなのはどのような条件 なのか、という問題がある。もしこの分割が必要なら、 FTP実装は行末綴り、ASCIIのテキストファイルでは、 EBCDICのテキストファイルでは、を使用するべきである。 もしFTP実装がこのテクニックを採用するなら、ファイルが ファイル構造に戻される場合のための逆変換も用意しなければ ならない。 3.1.2.1. FILE STRUCTURE File structure is the default to be assumed if the STRUcture command has not been used. ファイル構造は、STRUコマンドが使われなかった場合に 想定されるべきデフォルトである。 In file-structure there is no internal structure and the file is considered to be a continuous sequence of data bytes. ファイル構造では、内部の構造は無く、ファイルは データバイトの一連の連続であると考えられる。 3.1.2.2. RECORD STRUCTURE Record structures must be accepted for "text" files (i.e., files with TYPE ASCII or EBCDIC) by all FTP implementations. レコード構造は、全てのFTP実装において、「テキスト」 ファイル(つまり、TYPE ASCIIやTYPE EBCDICのファイル) を受け付けられなればならない。 In record-structure the file is made up of sequential records. レコード構造では、ファイルは一連のレコードから成る。 3.1.2.3. PAGE STRUCTURE To transmit files that are discontinuous, FTP defines a page structure. Files of this type are sometimes known as "random access files" or even as "holey files". In these files there is sometimes other information associated with the file as a whole (e.g., a file descriptor), or with a section of the file (e.g., page access controls), or both. In FTP, the sections of the file are called pages. 不連続なファイル転送するために、FTPはページ構造を定義する。 この種のファイルは、「ランダムアクセスファイル」あるいは 「穴ぼこファイル」として知られていたりする。これらのファイル の中には時々、ファイル全体(ファイル記述子)あるいはファイル の節(ページへのアクセス制御)、またはその両方に関連した他の 情報がある。FTPでは、ファイルの節をページと呼ぶ。 To provide for various page sizes and associated information, each page is sent with a page header. The page header has the following defined fields: 様々なページと関連情報を使用可能にするため、各ページは ページヘッダと共に送られる。ページヘッダは以下に定義 される領域(変数:訳注)を持つ。 Header Length ヘッダの長さ The number of logical bytes in the page header including this byte. The minimum header length is 4. このバイトを含むページヘッダの論理バイト数。 ヘッダの最小の長さは4。 Page Index ページの索引 The logical page number of this section of the file. This is not the transmission sequence number of this page, but the index used to identify this page of the file. ファイルのこの節の論理的なページ番号。 これは、このページの転送順番ではなく、ファイルの 中でこのページを指定するのに使われる索引である。 Postel & Reynolds [Page 16] RFC 959 October 1985 File Transfer Protocol Data Length データの長さ The number of logical bytes in the page data. The minimum data length is 0. ページデータの論理バイト数。最小のデータの長さは0。 Page Type ページのタイプ The type of page this is. The following page types are defined: このページのタイプ。以下のページタイプが定義されている: 0 = Last Page This is used to indicate the end of a paged structured transmission. The header length must be 4, and the data length must be 0. これは、ページ構造の転送の最後を示すのに使われる。 ヘッダの長さは4、データは0でなければならない。 1 = Simple Page This is the normal type for simple paged files with no page level associated control information. The header length must be 4. これは、制御情報に関連したページレベルを持たない 単純なページファイルのための通常のタイプである。 ヘッダの長さは4でなければならない。 2 = Descriptor Page This type is used to transmit the descriptive information for the file as a whole. このタイプは、全体としてファイルのための記述的情報 を転送するのに使われる。 3 = Access Controlled Page This type includes an additional header field for paged files with page level access control information. The header length must be 5. このタイプは、ページレベルのアクセス制御情報とページ化 されたファイルのための付加的ヘッダフィールドを含む。 ヘッダの長さは5でなければならない。 Optional Fields Further header fields may be used to supply per page control information, for example, per page access control. さらなるヘッダフィールドをページ毎の制御情報を供給 するために使ってもよい。例えば、ページ毎のアクセス制御。 All fields are one logical byte in length. The logical byte size is specified by the TYPE command. See Appendix I for further details and a specific case at the page structure. 全てのフィールドは長さが1論理バイトである。論理バイト サイズはTYPEコマンドで指定される。さらなる詳細とページ 構造に特化したケースのためには、付録Iを参照のこと。 A note of caution about parameters: a file must be stored and retrieved with the same parameters if the retrieved version is to Postel & Reynolds [Page 17] RFC 959 October 1985 File Transfer Protocol be identical to the version originally transmitted. Conversely, FTP implementations must return a file identical to the original if the parameters used to store and retrieve a file are the same. パラメータに関しての注意書き:もし取り戻されたバージョンが 最初に転送されたバージョンと同一であるべきなら、ファイルは 同じパラメータで保存/確保されなければならない。逆に、もし ファイルの保存と確保で使われたパラメータが同じものなら、 FTP実装は最初のものと同じファイルを返さなければならない。 3.2. ESTABLISHING DATA CONNECTIONS The mechanics of transferring data consists of setting up the data connection to the appropriate ports and choosing the parameters for transfer. Both the user and the server-DTPs have a default data port. The user-process default data port is the same as the control connection port (i.e., U). The server-process default data port is the port adjacent to the control connection port (i.e., L-1). データ転送の技術は、適切なポートにデータ接続を設置すること と、転送のパラメータを選択することから成る。ユーザ側、サーバ 側DTP両方ともデフォルトのデータポートを持つ。ユーザ側プロセス のデフォルトデータポートは、制御接続のポート(すなわちU)と 同じである。サーバ側プロセスのデフォルトデータポートは、制御 接続のポートに近接したポートである(すなわちL-1)。 The transfer byte size is 8-bit bytes. This byte size is relevant only for the actual transfer of the data; it has no bearing on representation of the data within a host's file system. 転送バイトサイズは8ビットバイトである。このバイトサイズは 実際のデータ転送にだけ関連がある;ホストのファイルシステム でのデータ表現には関係ない。 The passive data transfer process (this may be a user-DTP or a second server-DTP) shall "listen" on the data port prior to sending a transfer request command. The FTP request command determines the direction of the data transfer. The server, upon receiving the transfer request, will initiate the data connection to the port. When the connection is established, the data transfer begins between DTP's, and the server-PI sends a confirming reply to the user-PI. 受動的なデータ転送プロセス(これはユーザ側DTPかもしれないし、 2番目のサーバ側DTPかもしれない)は、転送要求のコマンドを 送るよりも、データポートで「聞き耳を立てる」ものとする。 FTPのリクエストコマンドは、データ転送の方向を決定する。サーバ は、転送のリクエストを受け取ると、そのポートへのデータ接続に 着手する。接続が構築されると、DTP間でデータ転送が始まり、 サーバ側PIはユーザ側PIに確認のための返答を送る。 Every FTP implementation must support the use of the default data ports, and only the USER-PI can initiate a change to non-default ports. 全てのFTP実装が、デフォルトデータポートの使用をサポートしなけ ればならず、ユーザ側PIだけがデフォルトでないポートへの変更に 着手することができる。 It is possible for the user to specify an alternate data port by use of the PORT command. The user may want a file dumped on a TAC line printer or retrieved from a third party host. In the latter case, the user-PI sets up control connections with both server-PI's. One server is then told (by an FTP command) to "listen" for a connection which the other will initiate. The user-PI sends one server-PI a PORT command indicating the data port of the other. Finally, both are sent the appropriate transfer commands. The exact sequence of commands and replies sent between the user-controller and the servers is defined in the Section on FTP Replies. ユーザはPORTコマンドを使って他のデータポートを指定することが できる。ユーザはTACラインプリンタにファイルをダンプしたり、 第3のホストからファイルを確保したがるかもしれない。後者の 場合、ユーザ側PIは両サーバ側PI間の制御接続を設置する。そして 一方のサーバは、(FTPコマンドで)もう一方が接続に着手するのに 「聞き耳を立てる」ように言われる。ユーザ側PIは、一方のサーバ側 PIにもう一方のデータポートを指定するPORTコマンドを送る。 最後に、両方に適切な転送コマンドが送られる。ユーザ側の制御者 と各サーバ間で送られるコマンドと返答の正確なシーケンスは FTP Repliesの章で記述する。 In general, it is the server's responsibility to maintain the data connection--to initiate it and to close it. The exception to this Postel & Reynolds [Page 18] RFC 959 October 1985 File Transfer Protocol is when the user-DTP is sending the data in a transfer mode that requires the connection to be closed to indicate EOF. The server MUST close the data connection under the following conditions: 一般に、データ接続の維持はサーバの責任である(それに着手し、 閉じる)。これの例外は、ユーザ側DTPがEOFを表すのに接続を 切断することを必要とする転送モードでデータを送っている時である。 サーバは、下記の条件の下でデータ接続を閉じなければ*ならない*。 1. The server has completed sending data in a transfer mode that requires a close to indicate EOF. EOFであることを示すために切断が必要となる転送モード で、サーバがデータの送信を完了した。 2. The server receives an ABORT command from the user. サーバがユーザからのABORTコマンドを受信した。 3. The port specification is changed by a command from the user. ユーザからのコマンドでポートの指定が変わった。 4. The control connection is closed legally or otherwise. 正式に、あるいはその他の理由で制御接続が閉じられた。 5. An irrecoverable error condition occurs. 回復できないエラー状況に出くわした。 Otherwise the close is a server option, the exercise of which the server must indicate to the user-process by either a 250 or 226 reply only. それ以外では、切断はサーバのオプションであり、そうするなら、 サーバは、250返答か226返答のどちらかをユーザ側プロセスに 指し示さなければならない。 3.3. DATA CONNECTION MANAGEMENT Default Data Connection Ports: All FTP implementations must support use of the default data connection ports, and only the User-PI may initiate the use of non-default ports. データ接続の デフォルトのポート:全てのFTP実装は、デフォルト のデータ接続のポートの使用をサポートしなければならず、ユーザ側PIだけ がデフォルトでないポートの使用に着手してよい。 Negotiating Non-Default Data Ports: The User-PI may specify a non-default user side data port with the PORT command. The User-PI may request the server side to identify a non-default server side data port with the PASV command. Since a connection is defined by the pair of addresses, either of these actions is enough to get a different data connection, still it is permitted to do both commands to use new ports on both ends of the data connection. デフォルトでないデータポートを協議決定すること:ユーザ側PIは PORTコマンドでデフォルトでないユーザ側のデータポートを指定 してよい。ユーザ側PIはPASVコマンドで、サーバ側に対して、 デフォルトでないサーバ側のデータポートを確認することを要求 してもよい。接続はアドレスのペアで定義されるので、これらの 行動のいずれも、異なるデータ接続を得るのに充分であり、 データ 接続の両端において新しいポートを使うために両方のコマンドを 使うことすら可能である。 Reuse of the Data Connection: When using the stream mode of data transfer the end of the file must be indicated by closing the connection. This causes a problem if multiple files are to be transfered in the session, due to need for TCP to hold the connection record for a time out period to guarantee the reliable communication. Thus the connection can not be reopened at once. データ接続の再利用:データ転送でストリームモードを使っている とき、ファイルの末尾は接続の切断で指し示されなければならない。 これは、そのセッションで複数のファイルが転送されなければならない ときに問題の原因になる。TCPは信頼できるコミュニケーションを 保証するためにタイムアウトの時までの接続の記録を保持する必要性 があるのである。したがってすぐに接続を再開することはできない。 There are two solutions to this problem. The first is to negotiate a non-default port. The second is to use another transfer mode. この問題には2つの解決法がある。まず、デフォルトでないポートを 使うこと。もう1つは、他の転送モード(ストリームモードでない モード)を使うことである。 A comment on transfer modes. The stream transfer mode is Postel & Reynolds [Page 19] RFC 959 October 1985 File Transfer Protocol inherently unreliable, since one can not determine if the connection closed prematurely or not. The other transfer modes (Block, Compressed) do not close the connection to indicate the end of file. They have enough FTP encoding that the data connection can be parsed to determine the end of the file. Thus using these modes one can leave the data connection open for multiple file transfers. 転送モードについての意見。ストリーム転送モードは、接続が 予定より早く閉じてしまったのかどうかを判断できないので、 本質的に信頼できるものではない。他の転送モード(Block、 Compressed)は、ファイルの末尾を指し示すために接続を 閉じることはない。これらは、ファイルの末尾を決定するために データ接続を分析することが可能なくらいのFTPエンコーディング を持っている。したがって、これらのモードを使うことで複数 のファイル転送のためにデータ接続を開いたままにすることが できる。 3.4. TRANSMISSION MODES The next consideration in transferring data is choosing the appropriate transmission mode. There are three modes: one which formats the data and allows for restart procedures; one which also compresses the data for efficient transfer; and one which passes the data with little or no processing. In this last case the mode interacts with the structure attribute to determine the type of processing. In the compressed mode, the representation type determines the filler byte. データを転送する上で次に考慮すべきことは、適切な転送モードを 選ぶことである。3つのモードがある:データを形式化し再開手続き を許可するもの;効率的な転送のためにデータを圧縮するもの;そして データをほとんど、あるいはまったく加工せずに送るもの。 最後のものの場合、モードは加工のタイプを決定する構造属性と 相互作用する。圧縮モードでは、表現タイプが詰め物のバイトを 決定する。 All data transfers must be completed with an end-of-file (EOF) which may be explicitly stated or implied by the closing of the data connection. For files with record structure, all the end-of-record markers (EOR) are explicit, including the final one. For files transmitted in page structure a "last-page" page type is used. 全てのデータ転送はファイルの末尾(EOF)で完了しなければ ならない。EOFは明確に述べられてもよいし、データ接続の 切断により暗に示されてもよい。レコード構造を持つファイル では、すべてのレコード末の印(EOR)は最後のレコードも 含めてはっきりしている。ページ構造で伝送されるファイルでは、 「最後のページ」というページタイプが使われる。 NOTE: In the rest of this section, byte means "transfer byte" except where explicitly stated otherwise. 備考:この章のこれ以降では、そうではないとはっきりと述べられて いない限り、バイトとは「転送バイト」を意味するものとする。 For the purpose of standardized transfer, the sending host will translate its internal end of line or end of record denotation into the representation prescribed by the transfer mode and file structure, and the receiving host will perform the inverse translation to its internal denotation. An IBM Mainframe record count field may not be recognized at another host, so the end-of-record information may be transferred as a two byte control code in Stream mode or as a flagged bit in a Block or Compressed mode descriptor. End-of-line in an ASCII or EBCDIC file with no record structure should be indicated by or , respectively. Since these transformations imply extra work for some systems, identical systems transferring non-record structured text files might wish to use a binary representation and stream mode for the transfer. 標準化された転送のために、送信側のホストは、内部の行末や レコード末の印を転送モードとファイル構造で規定された表現に 変換し、受信側のホストは、内部の印への逆変換を実行する。 IBMメインフレームのレコード数フィールドは、他のホストでは 理解されないかもしれないので、EORの情報はストリームモード では2バイトの制御コード、ブロックモードや圧縮モードでは フラッグのビットとして転送されるかもしれない。レコード構造 を持たないASCIIやEBCDICファイルの行末は、それぞれで指し示される。これらの変換は、いくつかのシステム では余分な仕事をほのめかしているので、非レコード構造の テキストファイルを転送している同様のシステムたちは、バイナリ 表現とストリームモードを転送に使いたがるかもしれない。 Postel & Reynolds [Page 20] RFC 959 October 1985 File Transfer Protocol The following transmission modes are defined in FTP: 以下の転送モードがFTPで定義されている: 3.4.1. STREAM MODE 3.4.1. ストリームモード The data is transmitted as a stream of bytes. There is no restriction on the representation type used; record structures are allowed. データはバイトの列として転送される。使われる表現タイプ に制限はない;レコード構造は許可されている。 In a record structured file EOR and EOF will each be indicated by a two-byte control code. The first byte of the control code will be all ones, the escape character. The second byte will have the low order bit on and zeros elsewhere for EOR and the second low order bit on for EOF; that is, the byte will have value 1 for EOR and value 2 for EOF. EOR and EOF may be indicated together on the last byte transmitted by turning both low order bits on (i.e., the value 3). If a byte of all ones was intended to be sent as data, it should be repeated in the second byte of the control code. レコード構造のファイルでは、EORとEOFはそれぞれ2バイトの 制御コードで表される。制御コードの最初のバイトは全て1、 エスケープ文字である。2番目のバイトは、EORでは最下位の ビットがオンで他は0、EOFでは最下位から2番目のビットが オンになる;つまり、このバイトはEORで1、EOFで2である。 EORかつEOFは、最後のバイトの最下位の2つのビットを共に オン(つまり3)にすることで表される。もし全て1のバイト をデータとして送りたいのであれば、 制御コードの2番目の バイトにそれが繰り返されるべきである。 If the structure is a file structure, the EOF is indicated by the sending host closing the data connection and all bytes are data bytes. もし構造がファイル構造なら、送信側がデータ接続を閉じる ことがEOFを指し示し、全てのバイトがデータバイトである。 3.4.2. BLOCK MODE The file is transmitted as a series of data blocks preceded by one or more header bytes. The header bytes contain a count field, and descriptor code. The count field indicates the total length of the data block in bytes, thus marking the beginning of the next data block (there are no filler bits). The descriptor code defines: last block in the file (EOF) last block in the record (EOR), restart marker (see the Section on Error Recovery and Restart) or suspect data (i.e., the data being transferred is suspected of errors and is not reliable). This last code is NOT intended for error control within FTP. It is motivated by the desire of sites exchanging certain types of data (e.g., seismic or weather data) to send and receive all the data despite local errors (such as "magnetic tape read errors"), but to indicate in the transmission that certain portions are suspect). Record structures are allowed in this mode, and any representation type may be used. ファイルは、1つかそれ以上のヘッダバイトに続く連続した データブロックとして転送される。ヘッダバイトはカウント フィールドと記述コードを含む。カウントフィールドは、 データブロックの全長をバイト数で指し示す、このようにして 次のデータブロック(詰め物ビットはない)の頭に印をつける。 記述コードが定義するもの:ファイルの最後のブロック (EOF)、レコードの最後のブロック(EOR)、再開の印 (Error Recovery and Restartの章を参照のこと)あるいは 疑わしいデータ(つまり、転送されているデータにエラーの 疑いがあり、信用できない)。これの最後のコードはFTP内部 でのエラー制御のためのものでは*ない*。ある種のデータ (地震や天気のデータ)を交換しているサイトの要求によって (「磁気テープ読込みエラー」などの)ローカルなエラーにも 係わらず全てのデータを送受信することが動機付けられたが、 伝送の中でその確実な部分を指し示すことは疑わしい。 このモードでレコード構造を使うことは可能であり、どんな 表現タイプを使ってもよい。 The header consists of the three bytes. Of the 24 bits of header information, the 16 low order bits shall represent byte count, and the 8 high order bits shall represent descriptor codes as shown below. ヘッダは3バイトから成る。ヘッダ情報の24のビットの内、 下位16ビットはバイト数を表現し、上位8ビットは以下に 示す記述コードを表現するものとする。 Postel & Reynolds [Page 21] RFC 959 October 1985 File Transfer Protocol Block Header +----------------+----------------+----------------+ | Descriptor | Byte Count | | 8 bits | 16 bits | +----------------+----------------+----------------+ The descriptor codes are indicated by bit flags in the descriptor byte. Four codes have been assigned, where each code number is the decimal value of the corresponding bit in the byte. 記述コードは、そのバイトの中のビットフラッグによって指し 示される。4つのコードが割り当てられていて、それぞれの コードナンバーはバイト中の10進数値の対応するビットである。 Code Meaning 128 End of data block is EOR データブロック末はEORである 64 End of data block is EOF データブロック末はEOFである 32 Suspected errors in data block データブロックにエラーの疑いあり 16 Data block is a restart marker データブロックは再開の印である With this encoding, more than one descriptor coded condition may exist for a particular block. As many bits as necessary may be flagged. このコード化では、特定のブロックに1つ以上のコードが記述 される場合があるかもしれない。必要なだけ多くのビットを フラッグしてかまわない。 The restart marker is embedded in the data stream as an integral number of 8-bit bytes representing printable characters in the language being used over the control connection (e.g., default--NVT-ASCII). (Space, in the appropriate language) must not be used WITHIN a restart marker. 再開の印は、制御接続で使われている言語(例えば、デフォルト のNVT-ASCII)の中で表示可能文字を表している8ビットバイト の必須の数字としてデータの列に埋め込まれる。(適切な 言語での空白)は再開の印の*中では*使われてはならない。 For example, to transmit a six-character marker, the following would be sent: 例えば、6文字の(再開の:訳注)印を転送するには、以下の ものが送られるだろう: +--------+--------+--------+ |Descrptr| Byte count | |code= 16| = 6 | +--------+--------+--------+ +--------+--------+--------+ | Marker | Marker | Marker | | 8 bits | 8 bits | 8 bits | +--------+--------+--------+ +--------+--------+--------+ | Marker | Marker | Marker | | 8 bits | 8 bits | 8 bits | +--------+--------+--------+ Postel & Reynolds [Page 22] RFC 959 October 1985 File Transfer Protocol 3.4.3. COMPRESSED MODE There are three kinds of information to be sent: regular data, sent in a byte string; compressed data, consisting of replications or filler; and control information, sent in a two-byte escape sequence. If n>0 bytes (up to 127) of regular data are sent, these n bytes are preceded by a byte with the left-most bit set to 0 and the right-most 7 bits containing the number n. 3種類の情報が送られる:通常データ、これはバイトの列で 送られる;圧縮データ、繰り返しか詰め物から成る;制御情報、 2バイトのエスケープエスケープシーケンスで送られる。 もしn>0バイト(127まで)の通常データが送られるなら、 これらnバイトは、最上位ビットを0、下位7ビットをnに セットしたバイトに続く。 Byte string: バイト列: 1 7 8 8 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |0| n | | d(1) | ... | d(n) | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ ^ ^ |---n bytes---| of data String of n data bytes d(1),..., d(n) d(1),..., d(n)はn個のデータバイトの列 Count n must be positive. nは正数 To compress a string of n replications of the data byte d, the following 2 bytes are sent: データバイトdのn回の繰り返しの列を圧縮するには、以下の 2バイトが送られる: Replicated Byte: 繰り返されるバイト: 2 6 8 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |1 0| n | | d | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ A string of n filler bytes can be compressed into a single byte, where the filler byte varies with the representation type. If the type is ASCII or EBCDIC the filler byte is (Space, ASCII code 32, EBCDIC code 64). If the type is Image or Local byte the filler is a zero byte. n個の詰め物バイトの列は1バイトに圧縮でき、その場合 詰め物バイトは表現タイプにより異なる。もしタイプがASCIIか EBCDICなら、詰め物バイトは(空白、ASCIIコードの32、 EBCDICコードの64)である。もしタイプがイメージか ローカルバイトなら、詰め物は0バイトである。 Filler String: 詰め物の列: 2 6 +-+-+-+-+-+-+-+-+ |1 1| n | +-+-+-+-+-+-+-+-+ The escape sequence is a double byte, the first of which is the Postel & Reynolds [Page 23] RFC 959 October 1985 File Transfer Protocol escape byte (all zeros) and the second of which contains descriptor codes as defined in Block mode. The descriptor codes have the same meaning as in Block mode and apply to the succeeding string of bytes. エスケープシーケンスは2バイトで、その最初のバイトはエスケープ バイト(全てのビットが0)で2番目のバイトはブロックモードで 定義された記述コードを含む。記述コードはブロックモードでの ものと同じ意味を持ち、後に続くバイト列に適用される。 Compressed mode is useful for obtaining increased bandwidth on very large network transmissions at a little extra CPU cost. It can be most effectively used to reduce the size of printer files such as those generated by RJE hosts. 圧縮モードは、CPUを少し余計に犠牲にして、とても大きな ネットワーク転送でより増加した帯域幅を得るのに役立つ。 (この文は、ちょっとアレだなあ:訳注) これは、RJEホストが生成するようなプリンタファイルのサイズ を減らすのに最も効果的に使うことができる。 3.5. ERROR RECOVERY AND RESTART There is no provision for detecting bits lost or scrambled in data transfer; this level of error control is handled by the TCP. However, a restart procedure is provided to protect users from gross system failures (including failures of a host, an FTP-process, or the underlying network). データ転送の途中で失われたり変わってしまったビットを探知する 規定はない;このレベルのエラー制御はTCPで扱われる。しかし ながら、(ホスト、FTPプロセスや基礎となるネットワークの失敗 を含む)酷いシステムエラーからユーザを保護するために、再開 手続きが与えられている。 The restart procedure is defined only for the block and compressed modes of data transfer. It requires the sender of data to insert a special marker code in the data stream with some marker information. The marker information has meaning only to the sender, but must consist of printable characters in the default or negotiated language of the control connection (ASCII or EBCDIC). The marker could represent a bit-count, a record-count, or any other information by which a system may identify a data checkpoint. The receiver of data, if it implements the restart procedure, would then mark the corresponding position of this marker in the receiving system, and return this information to the user. 再開手続きは、ブロックモードと圧縮モードのデータ転送だけで 定義されている。データの送信側は、データストリームにマーカー の情報を持つ特別なマーカーコードを挿入することが要求される。 マーカー情報は送信側にだけ意味があるが、これは制御接続における デフォルトの、あるいは取り決められた言語(ASCIIやEBCDIC)で 印刷可能な文字で構成されなければならない。マーカーは、ビット数 やレコード数、あるいはシステムがデータのチェックポイントを 特定できるような他の情報を表現している。データの受信側は、 もしそれが再開手続きを実装しているなら、受信側のシステムでの このマーカーの対応する位置にマークをし、この情報をユーザに 返すだろう。 In the event of a system failure, the user can restart the data transfer by identifying the marker point with the FTP restart procedure. The following example illustrates the use of the restart procedure. システム障害の際には、FTPの再開手続きでマーカーの位置を 確認することで、ユーザはデータ転送を再開することができる。 下の例では、再開手続きの使用を説明している。 The sender of the data inserts an appropriate marker block in the data stream at a convenient point. The receiving host marks the corresponding data point in its file system and conveys the last known sender and receiver marker information to the user, either directly or over the control connection in a 110 reply (depending on who is the sender). In the event of a system failure, the user or controller process restarts the server at the last server marker by sending a restart command with server's marker code as its argument. The restart command is transmitted over the control Postel & Reynolds [Page 24] RFC 959 October 1985 File Transfer Protocol connection and is immediately followed by the command (such as RETR, STOR or LIST) which was being executed when the system failure occurred. データの送信側は、データストリームの中の好きな位置に適切な マーカーのブロックを挿入する。受信側のホストは、そのファイル システムでの対応するデータの位置に印を付け、最後の送信側と 受信側のマーカー情報を、直接あるいは制御接続を介した110返答 (これは誰が送信側なのかに依る)でユーザに伝える。システム 障害の際には、ユーザか制御プロセスが、引数としてサーバの マーカーコードを与えた再開コマンドを送り、最後のサーバの マーカーからサーバを再開する。再開コマンドは、制御接続を介して 送信され、(RETR、STORやLISTのような)システムの失敗が 起こった時に実行されていたコマンドがすぐ後に来る。 4. FILE TRANSFER FUNCTIONS The communication channel from the user-PI to the server-PI is established as a TCP connection from the user to the standard server port. The user protocol interpreter is responsible for sending FTP commands and interpreting the replies received; the server-PI interprets commands, sends replies and directs its DTP to set up the data connection and transfer the data. If the second party to the data transfer (the passive transfer process) is the user-DTP, then it is governed through the internal protocol of the user-FTP host; if it is a second server-DTP, then it is governed by its PI on command from the user-PI. The FTP replies are discussed in the next section. In the description of a few of the commands in this section, it is helpful to be explicit about the possible replies. ユーザ側PIからサーバ側PIへのやり取りのチャンネルは、ユーザから 標準のサーバポートにTCP接続として構築される。ユーザ側 プロトコル解析部には、FTPコマンドを送り、受け取った返答を解釈する 責任がある;サーバ側PIはコマンドを解釈し、返答を送ってそのDTP (データ転送プロセス)にデータ接続を設置しデータを転送するよう 指示する。もしデータ転送の第2者(受動的な転送プロセス)が ユーザ側DTPなら、それはユーザ側FTPのホストの内部プロトコル を通して管理される;もしそれが2番目のサーバ側DTPであれば、 それはユーザ側PIからのコマンドでそのPIによって管理される。 FTP返答は次の章で議論される。この章の中のコマンドのうちの いくつかの描写では、(返って来る:訳注)可能性のある返答を はっきりさせておくのは役に立つ。 4.1. FTP COMMANDS 4.1.1. ACCESS CONTROL COMMANDS 4.1.1. アクセス制御コマンド The following commands specify access control identifiers (command codes are shown in parentheses). 以下のコマンドはアクセス制御のアイデンティファイアを 指定する(コマンドコードはカッコ内に記されている)。 USER NAME (USER) The argument field is a Telnet string identifying the user. The user identification is that which is required by the server for access to its file system. This command will normally be the first command transmitted by the user after the control connections are made (some servers may require this). Additional identification information in the form of a password and/or an account command may also be required by some servers. Servers may allow a new USER command to be entered at any point in order to change the access control and/or accounting information. This has the effect of flushing any user, password, and account information already supplied and beginning the login sequence again. All transfer parameters are unchanged and any file transfer in progress is completed under the old access control parameters. 引数はユーザを確認するTelnet文字である。ユーザの認証は、 ファイルシステムにアクセスするためにサーバよって要求される ものである。このコマンドは普通、制御接続が作られた後に ユーザによって転送される最初のコマンドである(いくつかの サーバはこれを要求するかもしれない)。パスワードコマンド と/またはアカウントコマンドによる付加的な認証情報もまた、 いくつかのサーバによって要求されるかもしれない。サーバは どの時点でも、制御接続と/または課金情報の変更を目的とした 新しいUSERコマンドが入力されるのを許可してもよい。これは、 すでに提供されているユーザ、パスワードと課金情報を洗い流し、 再びログインシーケンスを開始する効果を持つ。すべての転送 パラメータは変更無く、進行中のファイル転送は古い制御接続の パラメータのもとで完了される。 Postel & Reynolds [Page 25] RFC 959 October 1985 File Transfer Protocol PASSWORD (PASS) The argument field is a Telnet string specifying the user's password. This command must be immediately preceded by the user name command, and, for some sites, completes the user's identification for access control. Since password information is quite sensitive, it is desirable in general to "mask" it or suppress typeout. It appears that the server has no foolproof way to achieve this. It is therefore the responsibility of the user-FTP process to hide the sensitive password information. 引数はユーザのパスワードを特定するTelnet文字である。 このコマンドはユーザ名コマンド(たぶんUERコマンドの こと:訳注)のすぐ後に続かなければならず、さらに いくつかのサイトは、制御接続のためのユーザの認証を 完了する。パスワード情報は取り扱いに特に注意を要する ので、一般的に、それを「マスク」するかタイプアウトを 抑制するのが望ましい。したがって、パスワード情報を隠す ことはユーザ側FTPプロセスの責任である。 ACCOUNT (ACCT) The argument field is a Telnet string identifying the user's account. The command is not necessarily related to the USER 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. 引数はユーザの課金を認証するTelnet文字である。ログイン のために課金情報を必要とするサイトもあるし、ファイルの 書き込みのような特定のアクセスにだけこれを必要とする サイトもあるので、このコマンドが必ずもUSERコマンドと 関連していなくてはいけないわけではない。後者の場合、 このコマンドはいつでも到着するかもしれない。 There are reply codes to differentiate these cases for the automation: 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 return a 332 or 532 reply depending on whether it stores (pending receipt of the ACCounT command) or discards the command, respectively. これらの場合を自動的に区別するための返答コードがある: ログインのために課金情報が必要な時、成功したパスワード コマンドに対する返事は332返答コードである。一方、 ログインに課金情報が必要でないなら、成功したパスワード コマンドに対する返事は230である;さらに、もし対話の中で 後に発行されたコマンドに対して課金情報が必要とされるなら、 サーバはコマンドを(課金コマンドを受け付けるまで)保存 するのか処分したかによって、それぞれ332か532の返答を 返すべきである。 CHANGE WORKING DIRECTORY (CWD) This command allows the user to work with a different directory or dataset for file storage or retrieval without altering his login or accounting information. Transfer parameters are similarly unchanged. The argument is a pathname specifying a directory or other system dependent file group designator. このコマンドはユーザが、ログイン情報や課金情報を変更する ことなく、異なるディレクトリや、ファイルの保存や獲得ため のデータ集合で作業することを許可する。転送パラメータは 同様に変化しない。引数はディレクトリを指定するパス名か、 他のシステム依存のファイルグループの指定するものである。 CHANGE TO PARENT DIRECTORY (CDUP) This command is a special case of CWD, and is included to simplify the implementation of programs for transferring directory trees between operating systems having different Postel & Reynolds [Page 26] RFC 959 October 1985 File Transfer Protocol syntaxes for naming the parent directory. The reply codes shall be identical to the reply codes of CWD. See Appendix II for further details. このコマンドはCWDの特別な場合であり、親ディレクトリ の名付け方に異なる構文を持つオペレーティングシステム間 での、ディレクトリ構造を転送するためのプログラムの実装 を簡略化するための導入された。返答コードはCWDの返答 コードと同様であるとする。付録IIに詳細がある。 STRUCTURE MOUNT (SMNT) This command allows the user to mount a different file system data structure without altering his login or accounting information. Transfer parameters are similarly unchanged. The argument is a pathname specifying a directory or other system dependent file group designator. このコマンドはユーザが、ログイン情報や課金情報を変更 することなく、異なるファイルシステムのデータ構造を マウントすることを許可する。転送パラメータは同様に 変化しない。引数は、パス名を指定するディレクトリ あるいは他のシステム依存のファイルグループを指定する ものである。 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 control connection is left open. This is identical to the state in which a user finds himself immediately after the control connection is opened. A USER command may be expected to follow. このコマンドは、USERを終わらせ、進行中のどんな転送も 完了するのを許可されること以外は、全てのI/Oと課金情報 を洗い流す。全てのパラメータはデフォルトの設定にリセット され、制御接続は開いたまま残る。これは、制御接続が開いた 直後にユーザが置かれる状況と全く同じである。これに次いで USERコマンドが来ることが期待される。 LOGOUT (QUIT) This command terminates a USER and if file transfer is not in progress, the server closes the control 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. このコマンドはUSERを終了させ、もしファイル転送が進行中 でなければサーバは制御接続を閉じる。もしファイル転送が 進行中なら結果を返事するために接続は開いたまま残り、 それからサーバはそれを閉じる。もしユーザ側プロセスが いくつものUSERを使ってファイルを転送していて、閉じる ことを望まず、後でめいめいのために接続を再開するのなら、 QUITのかわりにREINコマンドを使うべきである。 An unexpected close on the control connection will cause the server to take the effective action of an abort (ABOR) and a logout (QUIT). 制御接続が予期せず閉じることは、サーバが実行中の行動を 中断(ABOR)しログアウト(QUIT)する原因となる。 4.1.2. 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 is 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: 全てのデータ転送パラメータはデフォルトの値を持っていて、 データ転送パラメータを指定するコマンドは、デフォルト パラメータの値を変更したい時にだけ必要になる。デフォルト 値は、最後に指定された値か、もし過去に指定された値がない なら標準のデフォルト値である。これは、サーバが有効な デフォルト値を「覚え」なければならないことを意味する。 これらのコマンドはFTPサービスのリクエストより前でなければ ならないが、順番はどうでもよい。下記のコマンドはデータ 転送パラメータを指定する: Postel & Reynolds [Page 27] RFC 959 October 1985 File Transfer Protocol DATA PORT (PORT) The argument is a HOST-PORT specification for the data port to be used in data connection. There are defaults for both the user and server data ports, and under normal circumstances this command and its reply are not needed. If this command 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: 引数は、データ接続で使われるデータポートのためのHOST-PORT の指定である。ユーザ側、サーバ側ともにデフォルトのデータ ポートがあり、普通の状況下では、このコマンドとその返事は 必要ない。もしこのコマンドが使われるなら、引数は32ビット のインターネットホストアドレスと16ビットのTCPポートアドレス を繋げたものである。このアドレス情報は8ビットのフィールド に分割され、各フィールドの値は(文字列で表現された)10進数 として転送される。フィールドはコンマで分けられる。port コマンドはこんなかんじになる: PORT h1,h2,h3,h4,p1,p2 where h1 is the high order 8 bits of the internet host address. h1と書いてある所がインターネットホストアドレスの上位8 ビットである。 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. このコマンドはサーバ側DTPに、ある(デフォルトデータ ポートではない)データポート上で「聞き耳を立て」、 転送コマンドの受理した時に転送を開始するのではなく 接続を待つようにリクエストする。このコマンドに対する 応答は、このサーバが聞き耳を立てているホストとポート のアドレスを含む。 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 (Space, ASCII code 32). 引数で、Data Representation and Storageの章で述べた表現 タイプを指定する。いくつものタイプが2番目のパラメータ を取る。最初のパラメータは1つのTelnet文字で表示され、 ASCIIとEBCDICの2番目の書式パラメータも同様である; ローカルバイトのための2番目のパラメータはバイトサイズ を示す10進数整数である。パラメータは(スペース、 ASCIIコードの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 - Local byte Byte size Postel & Reynolds [Page 28] RFC 959 October 1985 File Transfer Protocol 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. デフォルト表現タイプは、ASCIIでNon-printである。もし 書式パラメータが変わり、その後最初の引数だけが変わった なら、書式はデフォルトのNon-printに戻る。 FILE STRUCTURE (STRU) The argument is a single Telnet character code specifying file structure described in the Section on Data Representation and Storage. 引数はData Representation and Storageの章で説明した ファイル構造を指定する1つのTelnet文字のコードである。 The following codes are assigned for structure: 下記のコードが構造に割り当てられている: F - File (no record structure) R - Record structure P - Page structure The default structure is File. デフォルトの構造はFileである。 TRANSFER MODE (MODE) The argument is a single Telnet character code specifying the data transfer modes described in the Section on Transmission Modes. 引数はTransmission Modesの章で説明したデータ転送モード を指定する1つのTelnet文字のコードである。 The following codes are assigned for transfer modes: 下記のコードが転送モードに割り当てられている: S - Stream B - Block C - Compressed The default transfer mode is Stream. デフォルトの転送モードはストリームである。 4.1.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), and the language conventions of the control 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 (e.g., STOR or RETR). The data, when transferred in response to FTP service Postel & Reynolds [Page 29] RFC 959 October 1985 File Transfer Protocol commands, shall always be sent over the data connection, except for certain informative replies. The following commands specify FTP service requests: FTPサービスコマンドは、ユーザに要求されるファイル転送や ファイルシステム機能について定義している。FTPサービス コマンドの引数は普通パス名であろう。パス名の構文は (標準的なデフォルトが適用できる)サーバサイト側の慣習と 制御接続の言語慣習に従わなければならない。推奨される デフォルト処理は、最後に指定されたデバイス、ディレクトリ、 ファイル名か、ローカルユーザのために定義された標準的な デフォルトを使うことである。順番については、"rename from" コマンドの次が"rename to"コマンドでなければならないこと、 リスタートコマンドの次が中断してしまったサービスコマンド (STORやRETRなど)でなければならないことを除いては、 どうでもかまわない。FTPサービスコマンドに応じてデータ が転送される時、ある種の補足的な応答を除けば、そのデータ は常にデータ接続を経て送られる。下記のコマンドがFTP サービスコマンドである: 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. このコマンドは、サーバ側DTPにパス名で指定されたファイル のコピーを、データ接続のもう一端にある別のサーバ側あるいは ユーザ側DTPに、転送することを指示する。サーバサイトの ファイルの状況と内容に影響を及ぼしてはならない。 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. このコマンドは、サーバ側DTPがデータ接続経由で転送された データを受け入れ、サーバサイト上のファイルとしてそのデータ を保存することを指示する。もしパス名で指定されたファイル がサーバサイトに存在するなら、その内容は転送されている データによって書き換えられなければならない。パス名で指定 されたファイルがサーバサイトに存在しない場合、新しいファイル が作られなければならない。 STORE UNIQUE (STOU) This command behaves like STOR except that the resultant file is to be created in the current directory under a name unique to that directory. The 250 Transfer Started response must include the name generated. このコマンドは、結果として生成されるファイルがカレント ディレクトリ上にユニークな名前で作成されるべきであること を除けば、STORと同じような振る舞いをする。250転送開始 応答は、生成された名前を含まなければならない。 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. このコマンドは、サーバ側DTPに、データ接続経由で転送 されたデータを受け入れ、サーバサイトにあるファイルに データを蓄積することを指示する。もしパス名で指定された ファイルがサーバサイトに存在するなら、転送されたデータ はそのファイルに付け足されなければならない; そうでないなら、パス名で指定されたファイルがサーバサイト 上に作られなければならない。 ALLOCATE (ALLO) This command may be required by some servers to reserve sufficient storage to accommodate the new file to be transferred. The argument shall be a decimal integer representing the number of bytes (using the logical byte size) of storage to be reserved for the file. For files sent with record or page structure a maximum record or page size (in logical bytes) might also be necessary; this is indicated by a decimal integer in a second argument field of Postel & Reynolds [Page 30] RFC 959 October 1985 File Transfer Protocol the command. This second argument is optional, but when present should be separated from the first by the three Telnet characters R . This command shall be followed by a STORe or APPEnd command. The ALLO command should be treated as a NOOP (no operation) by those servers which do not require that the maximum size of the file be declared beforehand, and those servers interested in only the maximum record or page size should accept a dummy value in the first argument and ignore it. このコマンドは、これから転送される新しいファイルを収容 するのに充分なストレージを用意するのに、いくつかのサーバ によって必要とされるかもしれない。引数は、そのファイルの ために用意されるべきストレージのバイト数(論理バイトサイズ を使用)を表す10進数整数でなければならない。レコード構造 やページ構造で送られるファイルのために、最大のレコード およびページの長さ(論理バイトで)も必要だろう;これは、 このコマンドの第2引数である10進数整数によって表現される。 この第2引数はオプションだが、付ける場合には、3つのTelnet 文字 R によって第1引数と分割されていなければ ならない。このコマンドの後にはSTORE(STOR)かAPPEND (APPE)コマンドが来なければならない。ALLOコマンドは、 あらかじめ最大のファイルサイズが宣言される必要がないような サーバではNOOP(処理無し)として扱われるべきであり、最大 のレコードサイズ、ページサイズだけに興味があるようなサーバ は第1引数をダミー値とし、それを無視するべきである。 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 skips 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. 引数は、ファイル転送が再開されるべきサーバの印を表している。 このコマンドはファイル転送を指示するものではなく、データ上の 特定のチェックポイントまでファイルを読み飛ばすことを指示する。 このコマンドのすぐ後には、ファイル転送を再び開始する適切な FTPサービスコマンドが来なければならない。 RENAME FROM (RNFR) This command specifies the old pathname of 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"コマンドが来なければならない。 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. このコマンドは、直前の"rename from"コマンドで指定された ファイルの新しいパス名を指定する。この2つのコマンドを 一緒に使用することにより、ファイルの名前を変更することが できる。 ABORT (ABOR) This command tells the server to abort the previous FTP service command and any associated transfer of data. The abort command may require "special action", as discussed in the Section on FTP Commands, to force recognition by the server. No action is to be taken if the previous command has been completed (including data transfer). The control connection is not to be closed by the server, but the data connection must be closed. このコマンドは、サーバに直前のFTPサービスコマンドと関連 するデータ転送を中断することを指示する。FTP Commands の章で論じたように、中断コマンドはサーバによる認知を強制 するために「特別な動作」を必要とするかもしれない。もし 直前のコマンドが(データ転送も含めて)完了している場合、 行われるべき動作はない。制御接続がサーバによって閉じら れるべきではないが、データ接続は閉じられなければならない。 There are two cases for the server upon receipt of this command: (1) the FTP service command was already completed, or (2) the FTP service command is still in progress. このコマンドを受け付けた時、サーバには2つの場合がある: (1)FTPサービスコマンドはすでに完了した(2)FTP サービスコマンドはまだ進行中である。 Postel & Reynolds [Page 31] RFC 959 October 1985 File Transfer Protocol In the first case, the server closes the data connection (if it is open) and responds with a 226 reply, indicating that the abort command was successfully processed. 最初の場合、サーバはデータ接続を(もし開いていれば) 閉じ、中断コマンドが正常に処理されたことを示す226 返答で応答する。 In the second case, the server aborts the FTP service in progress and closes the data connection, returning a 426 reply to indicate that the service request terminated abnormally. The server then sends a 226 reply, indicating that the abort command was successfully processed. 2番目の場合、サーバは進行中のFTPサービスを中断し、 データ接続を閉じ、サービスリクエストが異常に終了した ことを示す426を返す。それからサーバは、中断コマンドが 正常に処理されたことを示す226返答を送る。 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. このコマンドは、パス名で指定されたサーバサイト上のファイル を削除させる。もし過剰なくらいの保護(「本当に削除しても よいのですか?」と尋ねるなど)が望まれるのなら、それは ユーザ側FTPプロセスが提供すべきである。 REMOVE DIRECTORY (RMD) This command causes the directory specified in the pathname to be removed as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). See Appendix II. このコマンドは、パス名で指定されたディレクトリ(もしパス名 が絶対パスなら)、またはカレントディレクトリのサブディレクトリ (もし相対パスなら)を取り除かせる。付録II を参照のこと。 MAKE DIRECTORY (MKD) This command causes the directory specified in the pathname to be created as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). See Appendix II. このコマンドは、パス名で指定されたディレクトリ(もしパス 名が絶対パスなら)、またはカレントディレクトリのサブディ レクトリ(もし相対パスなら)を作る。付録II を参照のこと。 PRINT WORKING DIRECTORY (PWD) This command causes the name of the current working directory to be returned in the reply. See Appendix II. このコマンドは、現在作業中のディレクトリの名前を返答 として返すように指示する。付録II を参照のこと。 LIST (LIST) This command causes a list to be sent from the server to the passive DTP. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the 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. (The user must Postel & Reynolds [Page 32] RFC 959 October 1985 File Transfer Protocol ensure that the TYPE is appropriately ASCII or EBCDIC). Since the information on a file may vary widely from system to system, this information may be hard to use automatically in a program, but may be quite useful to a human user. このコマンドは、サーバから受信側のDTPにリストを送るように 指示する。もしパス名がディレクトリや、他のファイルグループ を指定しているなら、サーバは指定されたディレクトリ内の ファイルのリストを転送すべきである。もしパス名がファイルを 指定しているなら、サーバはファイルの現在の情報を送るべきで ある。引数が指定されなかった場合、ユーザはカレントディレク トリかデフォルトディレクトリを暗に示しているものとする。 データ転送は、ASCIIタイプかEBCDICタイプでデータ接続を 介して行われる。(ユーザは、TYPEが適切にASCIIかEBCDICで あることを確認しなければならない)このファイルに関する情報 はシステムによって非常に変化に富むので、この情報はプログラム で自動的に使うのは難しいかもしれないが、人間のユーザにとっては とても有用だろう。 NAME LIST (NLST) This command causes a directory listing to be sent from server to user site. The pathname should specify a directory or other system-specific file group descriptor; a null argument implies the current directory. 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 or . (Again the user must ensure that the TYPE is correct.) This command is intended to return information that can be used by a program to further process the files automatically. For example, in the implementation of a "multiple get" function. このコマンドは、サーバからユーザサイトにディレクトリの 列挙を送ることを指示する。パス名はディレクトリか他の システム特有のファイルグループを記述するものを指定す べきである;引数が指定されなかった場合、カレントディ レクトリを示すものとする。サーバは一連のファイル名だけ を返し他の情報を返さない。データは、で 分割された有効なパス名の列をデータ接続を使ってASCII タイプかEBCDICタイプで転送されるだろう。(もう一度。 ユーザはTYPEが正しいかを確認しなければならない)この コマンドは、ファイルを自動的に処理するプログラムに よって使われることができる情報を返すことを目的とする。 例えば、「複数のget」機能の実装において。 SITE PARAMETERS (SITE) This command is used by the server to provide services specific to his system that are essential to file transfer but not sufficiently universal to be included as commands in the protocol. The nature of these services and the specification of their syntax can be stated in a reply to the HELP SITE command. このコマンドは、サーバが、ファイル転送に欠くことの できない、しかしプロトコルにコマンドとして含まれる ほど充分に普遍的でない、システム特有のサービスを 提供するために使われる。これらのサービスの本質と 構文法の特定はHELP SITEコマンドに対する返答で述べ られてもよい。 SYSTEM (SYST) This command is used to find out the type of operating system at the server. The reply shall have as its first word one of the system names listed in the current version of the Assigned Numbers document [4]. このコマンドはサーバのオペレーティングシステムの種類を 知るのに使われる。返答は、その最初の単語として、 Assgined Numbers documentの現行版に載っているシステム名 の1つを含むなければならない。 STATUS (STAT) This command shall cause a status response to be sent over the control connection in the form of a reply. The command may be sent during a file transfer (along with the Telnet IP and Synch signals--see the Section on FTP Commands) 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. If the argument is a pathname, the command is analogous to the "list" command except that data shall be Postel & Reynolds [Page 33] RFC 959 October 1985 File Transfer Protocol transferred over the control 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. このコマンドは状態の応答を、返答の形でデータ接続を経て 送ることを指示する。このコマンドは、サーバが進行中の操作 の状態と共に応答する場合のファイル転送の最中に(Telnet IP とSynch信号と共に --FTP Commands章を参照のこと)送られて もよいし、2つのファイル転送の間(つまり転送中でないとき) に送られてもよい。後者の場合、このコマンドは引数を含んでも よい。もし引数がパス名であれば、このコマンドはそのデータが 制御接続を介して転送されることを除けば"list"コマンドと同類の ものである。もし部分的パス名が与えられたら、サーバはその指定 に関連したファイル名か属性のリストで応答するだろう。もし引数 が与えられなかったら、サーバはサーバ側FTPプロセスの一般的な ステータス情報を返すべきである。これは、全ての転送パラメータ の現在の値と接続の状態を含むべきである。 HELP (HELP) This command shall cause the server to send helpful information regarding its implementation status over the control 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 211 or 214. It is suggested that HELP be allowed before entering a USER command. The server may use this reply to specify site-dependent parameters, e.g., in response to HELP SITE. このコマンドはサーバに、その実装状況に関して役に立つ情報 を制御接続を介してユーザに送ることを指示する。このコマンド は(任意のコマンド名の)引数を取り、応答としてより特化した 情報を返すだろう。返事は211か214タイプである。HELPはUSER コマンドの入力より前に許されることが推奨される。サーバは この返答をサイト特有のパラメータを指定するのに使ってもよい、 例えばHELP SITEに応じて。 NOOP (NOOP) This command does not affect any parameters or previously entered commands. It specifies no action other than that the server send an OK reply. このコマンドは、如何なるパラメータにも以前に入力された コマンドにも影響を与えてはならない。サーバがOKと返事 する以外はどんな反応も指定しない。 The File Transfer Protocol follows the specifications of the Telnet protocol for all communications over the control connection. Since the language used for Telnet communication may be a negotiated option, all references in the next two sections will be to the "Telnet language" and the corresponding "Telnet end-of-line code". Currently, one may take these to mean NVT-ASCII and . No other specifications of the Telnet protocol will be cited. ファイル転送プロトコルは、制御接続を介するすべてのやり取り において、Telnetプロトコルの仕様に従う。Telnetのやり取りで 使われる言語は協議決定されるオプションでもよいので、次の2つ のセクションにある全ての参照は「Telnet言語」や適当な「Telnet の行末コード」にあたる。(この辺よくわからない:訳注)それ 以外のTelnetプロトコルの仕様は流用されない。 FTP commands are "Telnet strings" terminated by the "Telnet end of line code". The command codes themselves are alphabetic characters terminated by the character (Space) if parameters follow and Telnet-EOL otherwise. The command codes and the semantics of commands are described in this section; the detailed syntax of commands is specified in the Section on Commands, the reply sequences are discussed in the Section on Sequencing of Commands and Replies, and scenarios illustrating the use of commands are provided in the Section on Typical FTP Scenarios. FTPコマンドは、「Telnetの行末コード」で終わる「Telnet文字」である。 コマンドのコード自体は、もしパラメータが続くなら(空白)、 そうでなければTelnetのEOLで終わるアルファベット文字である。コマンド のコードとその意味はこの章で述べられている;コマンドの細かい構文は Commandsの章で指し示され、返答シーケンスはSequencing of Commands and Repliesの章で説明され、コマンド使用の筋書きはTypical FTP Scenaios の章で与えられる。 FTP commands may be partitioned as those specifying access-control identifiers, data transfer parameters, or FTP service requests. Certain commands (such as ABOR, STAT, QUIT) may be sent over the control connection while a data transfer is in progress. Some Postel & Reynolds [Page 34] RFC 959 October 1985 File Transfer Protocol servers may not be able to monitor the control and data connections simultaneously, in which case some special action will be necessary to get the server's attention. The following ordered format is tentatively recommended: FTPコマンドは、制御接続の認証を指定するもの、データ転送の パラメータを指定するもの、FTPサービスの要求を指定するものに 分けられる。(ABOR、STATやQUITのような)ある種のコマンドは、 データ転送の進行中に制御接続を介して送られるかもしれない。 制御接続とデータ接続の両方を同時に監視することができないサーバ もあるかもしれない、その場合、サーバの注意を得るための特別な 行動が必要になるだろう。以下に並べられた書式は試験的に勧められる ものである: 1. User system inserts the Telnet "Interrupt Process" (IP) signal in the Telnet stream. 1. ユーザシステムが、Telnetストリームに「プロセス割り込み (Interrupt Process)」(IP)シグナルを挿入する。 2. User system sends the Telnet "Synch" signal. 2. ユーザシステムが、Telnetの「同期(Synch)」シグナルを送る。 3. User system inserts the command (e.g., ABOR) in the Telnet stream. 3. ユーザシステムが、Telnetストリームに(ABORのような) コマンドを挿入する。 4. Server PI, after receiving "IP", scans the Telnet stream for EXACTLY ONE FTP command. 4. サーバ側PIは、「IP」を受け取った後、*正確に1つのFTPコマンド* をTelnetストリームから読み取る。 (For other servers this may not be necessary but the actions listed above should have no unusual effect.) (他のサーバ(制御接続とデータ接続を同時に監視できるサーバ :訳注)にはこれは必要ではないだろうが、上に並べられた行動が 特殊な効果を持ってはいけない。) 4.2. FTP REPLIES Replies to File Transfer Protocol commands are devised to ensure the synchronization of requests and actions in the process of file transfer, and to guarantee that the user process always knows the state of the Server. Every command must generate at least one reply, although there may be more than one; in the latter case, the multiple replies must be easily distinguished. In addition, some commands occur in sequential groups, such as USER, PASS and ACCT, or RNFR and RNTO. The replies show the existence of an intermediate state if all preceding commands have been successful. A failure at any point in the sequence necessitates the repetition of the entire sequence from the beginning. FTPコマンドに対する返事は、ファイル転送の過程でのリクエストと アクションの同期を確実にし、ユーザプロセスが常にサーバの状態を 知っていることを保証するために考案された。各コマンドは少なくと も1つの返事を生成しなければならないが、1つより多い返事を生成 するものもあるだろう;後者の場合、複数の返事は簡単に区別でき なくてはならない。加えて、いくつかのコマンドは一連のコマンド群 を発生させる、例えばUSERはPASSとACCT、RNFRはRNTOのように。 もしすべての先立つコマンドが成功しているなら、返事は中間の状況 の存在を示す。一連のコマンドの如何なる点での失敗も、最初から 全ての流れを繰り返すことを必要とする。 The details of the command-reply sequence are made explicit in a set of state diagrams below. コマンドと返答のやり取りは、下の状態図で明らかにされる。 An FTP reply consists of a three digit number (transmitted as three alphanumeric characters) followed by some text. The number is intended for use by automata to determine what state to enter next; the text is intended for the human user. It is intended that the three digits contain enough encoded information that the user-process (the User-PI) will not need to examine the text and may either discard it or pass it on to the user, as appropriate. In particular, the text may be server-dependent, so there are likely to be varying texts for each reply code. FTP応答は、いくらかのテキストを従えた3つの10進数整数 (3つのアルファベット文字で伝えられる)から成る。数字は 次に入力すべき状態が何であるかをコンピュータが決定する ためのものである;テキストは人間のユーザのためのものである。 3つの数値は、ユーザ側のプロセス(ユーザ側PI)がテキストを 調べる必要がなく、それを破棄するかユーザに渡すかの適当な 方を行うように、充分にコード化された情報を含むようになって いる。特に、テキストはサーバに依存するかもしれないので、 それぞれの応答コードによりテキストは変化に富む傾向がある だろう。 A reply is defined to contain the 3-digit code, followed by Space Postel & Reynolds [Page 35] RFC 959 October 1985 File Transfer Protocol , followed by one line of text (where some maximum line length has been specified), and terminated by the Telnet end-of-line code. There will be cases however, where the text is longer than a single line. In these cases the complete text must be bracketed so the User-process knows when it may stop reading the reply (i.e. stop processing input on the control connection) and go do other things. This requires a special format on the first line to indicate that more than one line is coming, and another on the last line to designate it as the last. At least one of these must contain the appropriate reply code to indicate the state of the transaction. To satisfy all factions, it was decided that both the first and last line codes should be the same. 返答は3つの数値と、それに続く空白と1行のテキスト (ここでは、何か行の最大長が指定されている)を含み、 Telnetのend-of-lineコードで終了する。しかし、テキストが1行 よりも長い場合もあるだろう。この場合、完全なテキストは、 ユーザ側プロセスがいつ返事を読み終え(つまり、制御接続上 での入力を処理するのをやめる)、次の作業に移ったらいいか を知るためにひとまとめにされなければならない。最初の行 では1つ以上の行が来ることを示すために、また最後に行では それが最後であることを明示するために、特別な書式が要求 される。少なくともこれらの内の1つは、やり取りの状況を 示すための適切な返答コードを含んでいる必要がある。これら 全ての要求を満たすために、最初の行と最後の行のコードが 同じであるべきであると決定された。 Thus the format for multi-line replies is that the first line will begin with the exact required reply code, followed immediately by a Hyphen, "-" (also known as Minus), followed by text. The last line will begin with the same code, followed immediately by Space , optionally some text, and the Telnet end-of-line code. したがって、複数行の返事の形式は、最初の行は厳密に必要と される返答コードで始まり、すぐ後にハイフン"-"(マイナスと しても知られている)が続いてテキストが続く。最後の行は 同じく応答コードで始まり、すぐ後に空白が続き、オプ ションとしていくらかのテキストが入って、最後にTelnetの end-of-lineコードで終わる。 For example: 123-First line Second line 234 A line beginning with numbers 123 The last line The user-process then simply needs to search for the second occurrence of the same reply code, followed by (Space), at the beginning of a line, and ignore all intermediary lines. If an intermediary line begins with a 3-digit number, the Server must pad the front to avoid confusion. ユーザ側プロセスは単に、(空白)が後に続く同じ返答 コードの2回目の発生を行頭で探し、中間にある行を全て無視 する必要があるだけである。もし間に入るある行が3つの数字 で始まるのなら、サーバは混乱を避けるために詰め物をしなけ ればならない。 This scheme allows standard system routines to be used for reply information (such as for the STAT reply), with "artificial" first and last lines tacked on. In rare cases where these routines are able to generate three digits and a Space at the beginning of any line, the beginning of each text line should be offset by some neutral text, like Space. この案は、人為的な最初の行、最後の行を付加することにより、 (STATの返答のような)返答の情報のために標準的なシステム ルーチンを使えるようにする。これらのルーチンが行頭に3つの 数値と空白を生成することが出来るような稀なケースでは、テキ スト行の頭は空白のような中立なテキストで埋め合わせられるべ きである。 This scheme assumes that multi-line replies may not be nested. この案は、複数行に渡る返事が入れ子にしてはならないことを 仮定している。 The three digits of the reply each have a special significance. This is intended to allow a range of very simple to very sophisticated responses by the user-process. The first digit denotes whether the response is good, bad or incomplete. (Referring to the state diagram), an unsophisticated user-process will be able to determine its next action (proceed as planned, Postel & Reynolds [Page 36] RFC 959 October 1985 File Transfer Protocol redo, retrench, etc.) by simply examining this first digit. A user-process that wants to know approximately what kind of error occurred (e.g. file system error, command syntax error) may examine the second digit, reserving the third digit for the finest gradation of information (e.g., RNTO command without a preceding RNFR). 返答の3つの数値はそれぞれ特別な意味を持つ。これはユーザプロ セスに、とても簡単な応対からとても洗練されたものまでを許すため のものである。最初の数値は、応答が良い、悪い、未完全のどれで あるかを提供する。(状況図を参照)洗練されていないユーザプロ セスは、ただ最初の数値を見るだけで次の行動(計画通りに進める か、もう一度か、中断かなど)を決めることができるだろう。どの ようなエラーが起きたのかおおよその見当を付けることを望むユーザ プロセスは2番目の数値を、最も繊細な階級の情報(例えば、RNFR 無しのRNTOコマンドなど)のための残りの3番目の数値を調べる ことができる。 There are five values for the first digit of the reply code: 返答コードの最初の数値には、5つの値がある: 1yz Positive Preliminary reply 肯定的な予備返答 The requested action is being initiated; expect another reply before proceeding with a new command. (The user-process sending another command before the completion reply would be in violation of protocol; but server-FTP processes should queue any commands that arrive while a preceding command is in progress.) This type of reply can be used to indicate that the command was accepted and the user-process may now pay attention to the data connections, for implementations where simultaneous monitoring is difficult. The server-FTP process may send at most, one 1yz reply per command. 要求された行動に着手している;次の新しいコマンドの前に もう1つの返事を待て。(ユーザプロセスが、もう1つの 返答の前に次のコマンドを送ることはプロトコルを脅かす; しかしサーバFTPプロセスは、以前のコマンドが進行中の間 に届いた如何なるコマンドもキューすべきである)この種の 返事はコマンドが受け入れられたことを示すために使うこと ができ、同時モニタリングの難しいような実装では、ユーザ 側プロセスはデータ接続に注意を払ってよい。サーバ側FTP プロセスは1つのコマンドに対して多くても1回、1yzの返事 を送ってよい。 2yz Positive Completion reply 肯定的な完了返答 The requested action has been successfully completed. A new request may be initiated. リクエストされた行動は成功のもとに終了した。 新しいリクエストに着手してよい。 3yz Positive Intermediate reply 肯定的な中間返答 The command has been accepted, but the requested action is being held in abeyance, pending receipt of further information. The user should send another command specifying this information. This reply is used in command sequence groups. コマンドは受け入れられたが、さらなる情報の到着を待って リクエストされた行動は停止中である。ユーザは、その情報 を指定するための他のコマンドを送るべきである。この返事 はグループ化されたコマンドのやり取りで使われる。 4yz Transient Negative Completion reply 一時的な否定完了返答 The command was not accepted and the requested action did not take place, but the error condition is temporary and the action may be requested again. The user should return to the beginning of the command sequence, if any. It is difficult to assign a meaning to "transient", particularly when two distinct sites (Server- and User-processes) have to agree on the interpretation. Each reply in the 4yz category might have a slightly different time value, but the intent is that the Postel & Reynolds [Page 37] RFC 959 October 1985 File Transfer Protocol user-process is encouraged to try again. A rule of thumb in determining if a reply fits into the 4yz or the 5yz (Permanent Negative) category is that replies are 4yz if the commands can be repeated without any change in command form or in properties of the User or Server (e.g., the command is spelled the same with the same arguments used; the user does not change his file access or user name; the server does not put up a new implementation.) コマンドは受け入れられず要求された行動は行われなかった が、エラーの状態は一時的なものであり、その行動はもう 一度リクエストされてもよい。ユーザは、場合によっては、 一連のコマンドの最初に戻るべきである。「一時」の意味 を決めるのは難しい、特に2つの別のサイト(サーバ側と ユーザ側のプロセス)が解釈の上で一致しなけらばならない 時は。4yzのカテゴリの応答はそれぞれ、微妙に異なる時間 の値を持つだろうが、ユーザ側プロセスに再試行を促すこと を意図している。返事が4yzにも5yz(恒久的否定)にも当て はまる場合に、どちらかを決定するおおざっぱな方法は、 コマンドがその形やユーザ、サーバのプロパティを変更せず (コマンドが、同じ引数で同じように書かれる;ユーザは ファイルアクセスやユーザ名を変えない;サーバは新しい 実装を提供しない)に繰り替えされてもよいのであれば、 返事は4yzである。 5yz Permanent Negative Completion reply 恒久的な否定的完了返答 The command was not accepted and the requested action did not take place. The User-process is discouraged from repeating the exact request (in the same sequence). Even some "permanent" error conditions can be corrected, so the human user may want to direct his User-process to reinitiate the command sequence by direct action at some point in the future (e.g., after the spelling has been changed, or the user has altered his directory status.) コマンドは受け入れられず、リクエストされた行動は行われ なかった。ユーザ側プロセスが(同じ順序で)そのリクエスト を繰り替えすことを推奨しない。「恒久的」エラー状態とは いえ、そのいくつは改善されるかもしれないので、人間のユーザ は将来のどの時点かに直接的な行動で、ユーザ側プロセスが コマンドのやりとりを再着手するように指揮することを望む かもしれない(綴りを変えたり、ディレクトリの状態に変更 を加えた後など)。 The following function groupings are encoded in the second digit: 2番目には以下の機能の分類がコード化されている: x0z Syntax - These replies refer to syntax errors, syntactically correct commands that don't fit any functional category, unimplemented or superfluous commands. 構文 - これらの返答は構文エラー、構文が正しいコマンド でも機能するカテゴリに適合しない、未実装または不必要 なコマンドなどを言及している。 x1z Information - These are replies to requests for information, such as status or help. 情報 - これらは、状況やヘルプなど、情報を得るための リクエストに対する返答である。 x2z Connections - Replies referring to the control and data connections. 接続 - 制御接続やデータ接続に関連した返答。 x3z Authentication and accounting - Replies for the login process and accounting procedures. 証明と課金情報 - ログインプロセスや課金手続きのための返答。 x4z Unspecified as yet. 現時点では未定義。 x5z File system - These replies indicate the status of the Server file system vis-a-vis the requested transfer or other file system action. ファイルシステム - これらの返答は、要求された転送や 他のファイルシステムのアクションに関して、サーバ側 ファイルシステムの状況を示す。 The third digit gives a finer gradation of meaning in each of the function categories, specified by the second digit. The list of replies below will illustrate this. Note that the text Postel & Reynolds [Page 38] RFC 959 October 1985 File Transfer Protocol associated with each reply is recommended, rather than mandatory, and may even change according to the command with which it is associated. The reply codes, on the other hand, must strictly follow the specifications in the last section; that is, Server implementations should not invent new codes for situations that are only slightly different from the ones described here, but rather should adapt codes already defined. 3番目の数値は、2番目の数値で指定された機能グループそれぞれ の、より立ち入った意味を提供する。下記の返答リストでこれを 説明する。個々の返答に関連した文は、強制されるものではなく 推奨されるものであり、また関連するコマンドに伴い変更される ことすらあるかもしれないことに注意すること。一方、返答コード は前章の仕様に厳密に従わなくてはならない;つまり、サーバ実装 は、ここで述べられているものと微妙な違いしかないような状況の ために新しいコードを作り出すべきではなく、むしろここに定義 されているコードに合うようにすべきである。 A command such as TYPE or ALLO whose successful execution does not offer the user-process any new information will cause a 200 reply to be returned. If the command is not implemented by a particular Server-FTP process because it has no relevance to that computer system, for example ALLO at a TOPS20 site, a Positive Completion reply is still desired so that the simple User-process knows it can proceed with its course of action. A 202 reply is used in this case with, for example, the reply text: "No storage allocation necessary." If, on the other hand, the command requests a non-site-specific action and is unimplemented, the response is 502. A refinement of that is the 504 reply for a command that is implemented, but that requests an unimplemented parameter. TYPEやALLOのように実行がうまくいってもユーザ側プロセス に新しい情報を提供しないコマンドでは、コード200の返答が 返されて終わる。また、例えばTOPS20のサイトでのALLOの ように、もし特定のサーバ側FTPプロセスが、あるコマンドが そのコンピュータシステムに関連がないのでそのコマンドを 実装していないとしても、単純なユーザ側プロセスがその後の 処理を進行できることが解るように、肯定的な完了返答は やはり望まれる。この場合コード202の返答が、例えば 「No storage allocation necessary.」のようなテキストと共に 使われる。一方、コマンドがサイト特有でない行動を要求して いてかつ未実装であるなら、応答は502である。これのより 洗練されたものはコード504返答で、これは実装されてはいる が未実装のパラメータを要求しているコマンドに対するものである。 4.2.1 Reply Codes by Function Groups 200 Command okay. コマンドは成功した 500 Syntax error, command unrecognized. 構文エラー、コマンドが理解できない。 This may include errors such as command line too long. これは、コマンド行が長すぎるなどのエラーも含んでもかまわない。 501 Syntax error in parameters or arguments. パラメータまたは引数に構文エラーがある 202 Command not implemented, superfluous at this site. コマンドは実装されていない、このサイトでは関連がない 502 Command not implemented. コマンドは実装されていない 503 Bad sequence of commands. コマンドの順序が悪い 504 Command not implemented for that parameter. そのパラメータではコマンドは実装されていない Postel & Reynolds [Page 39] RFC 959 October 1985 File Transfer Protocol 110 Restart marker reply. 再開始の目印の返答 In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm Where yyyy is User-process data stream marker, and mmmm server's equivalent marker (note the spaces between markers and "="). この場合、テキストは正確で特定の実装が残されていてはなら ない;このように読まなければならない: MARK yyyy = mmmm yyyyはユーザ側プロセスのデータストリームの目印で、mmmm はサーバ側プロセスのデータストリームの目印である(目印と"="の 間のスペースに注意) 211 System status, or system help reply. システムの状況、またはシステムヘルプへの返答 212 Directory status. ディレクトリの状況 213 File status. ファイルの状況 214 Help message. ヘルプメッセージ On how to use the server or the meaning of a particular non-standard command. This reply is useful only to the human user. サーバの使用法や特有の標準的でないコマンドの使い方に ついて。この返答は人間のユーザにのみ役に立つ。 215 NAME system type. システムタイプ。 Where NAME is an official system name from the list in the Assigned Numbers document. NAMEはAssigned Numbers documentの表にある公式な システム名。 120 Service ready in nnn minutes. nnn分でサービスの準備ができる 220 Service ready for new user. 新しいユーザのための準備ができている 221 Service closing control connection. 制御接続を閉じている Logged out if appropriate. もし適切なら、ログアウトされる(??:訳注)。 421 Service not available, closing control connection. サービスは使用出来ない、制御接続を閉じている This may be a reply to any command if the service knows it must shut down. サービス(側)がシャットダウンしなくてはならないことを 知っている場合、これはどんなコマンドの返答にも成り得る。 125 Data connection already open; transfer starting. データ接続は既に開いている;転送が始まる 225 Data connection open; no transfer in progress. データ接続は開いている;進行中の転送はない 425 Can't open data connection. データ接続を開くことができない 226 Closing data connection. データ接続を閉じている Requested file action successful (for example, file transfer or file abort). リクエストされたファイル処理は成功した(例えば、ファイル 転送やファイル中断など) 426 Connection closed; transfer aborted. 接続は閉じた;転送は中断された 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). 受動モードに突入 230 User logged in, proceed. ユーザはログインした、続けて 530 Not logged in. ログインしてない 331 User name okay, need password. ユーザ名はOK、パスワードが必要 332 Need account for login. ログインに課金情報が必要 532 Need account for storing files. ファイルの保存には課金情報が必要 Postel & Reynolds [Page 40] RFC 959 October 1985 File Transfer Protocol 150 File status okay; about to open data connection. ファイルの状態はOK;データ接続を開くところ 250 Requested file action okay, completed. リクエストされたファイル操作はOK、完了 257 "PATHNAME" created. "PATHNAME"が作られた 350 Requested file action pending further information. リクエストされたファイル操作は、さらなる情報を待って待機中 450 Requested file action not taken. リクエストされたファイル操作は行われなかった File unavailable (e.g., file busy). ファイルが使用可能でない(ファイルがbusy)。 550 Requested action not taken. リクエストされた操作は行われなかった File unavailable (e.g., file not found, no access). ファイルが使用可能でない(ファイルが見つからない、アクセスできない) 451 Requested action aborted. Local error in processing. リクエストされた操作は中断した。処理中にローカルなエラーが発生 551 Requested action aborted. Page type unknown. リクエストされた操作は中断した。ページタイプが不明 452 Requested action not taken. リクエストされた操作は行われなかった Insufficient storage space in system. システムの空き容量が不十分 552 Requested file action aborted. リクエストされた操作は中断した Exceeded storage allocation (for current directory or dataset). (現在のディレクトリまたはデータ集合に)確保された ストレージを超過 553 Requested action not taken. リクエストされた操作は行われなかった File name not allowed. ファイル名が許可できない 4.2.2 Numeric Order List of Reply Codes 110 Restart marker reply. In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm Where yyyy is User-process data stream marker, and mmmm server's equivalent marker (note the spaces between markers and "="). 120 Service ready in nnn minutes. 125 Data connection already open; transfer starting. 150 File status okay; about to open data connection. Postel & Reynolds [Page 41] RFC 959 October 1985 File Transfer Protocol 200 Command okay. 202 Command not implemented, superfluous at this site. 211 System status, or system help reply. 212 Directory status. 213 File status. 214 Help message. On how to use the server or the meaning of a particular non-standard command. This reply is useful only to the human user. 215 NAME system type. Where NAME is an official system name from the list in the Assigned Numbers document. 220 Service ready for new user. 221 Service closing control connection. Logged out if appropriate. 225 Data connection open; no transfer in progress. 226 Closing data connection. Requested file action successful (for example, file transfer or file abort). 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). 230 User logged in, proceed. 250 Requested file action okay, completed. 257 "PATHNAME" created. 331 User name okay, need password. 332 Need account for login. 350 Requested file action pending further information. 421 Service not available, closing control connection. This may be a reply to any command if the service knows it must shut down. 425 Can't open data connection. 426 Connection closed; transfer aborted. 450 Requested file action not taken. File unavailable (e.g., file busy). 451 Requested action aborted: local error in processing. 452 Requested action not taken. Insufficient storage space in system. Postel & Reynolds [Page 42] RFC 959 October 1985 File Transfer Protocol 500 Syntax error, command unrecognized. This may include errors such as command line too long. 501 Syntax error in parameters or arguments. 502 Command not implemented. 503 Bad sequence of commands. 504 Command not implemented for that parameter. 530 Not logged in. 532 Need account for storing files. 550 Requested action not taken. File unavailable (e.g., file not found, no access). 551 Requested action aborted: page type unknown. 552 Requested file action aborted. Exceeded storage allocation (for current directory or dataset). 553 Requested action not taken. File name not allowed. 5. DECLARATIVE SPECIFICATIONS 5.1. MINIMUM IMPLEMENTATION In order to make FTP workable without needless error messages, the following minimum implementation is required for all servers: 不必要なエラーメッセージ無しにFTPが働けるようにするために、 全てのサーバで、下の最小の実装が必要とされる: TYPE - ASCII Non-print MODE - Stream STRUCTURE - File, Record COMMANDS - USER, QUIT, PORT, TYPE, MODE, STRU, for the default values RETR, STOR, NOOP. The default values for transfer parameters are: 転送パラメータのデフォルト値は: TYPE - ASCII Non-print MODE - Stream STRU - File All hosts must accept the above as the standard defaults. 全てのホストが、標準のデフォルト値として上の物を受け付け なければならない。 Postel & Reynolds [Page 43] RFC 959 October 1985 File Transfer Protocol 5.2. CONNECTIONS The server protocol interpreter shall "listen" on Port L. The user or user protocol interpreter shall initiate the full-duplex control connection. Server- and user- processes should follow the conventions of the Telnet protocol as specified in the ARPA-Internet Protocol Handbook [1]. Servers are under no obligation to provide for editing of command lines and may require that it be done in the user host. The control connection shall be closed by the server at the user's request after all transfers and replies are completed. サーバ側プロトコル解析部はポートLで「聞き耳と立てて」いなけれ ばならない。ユーザ、あるいはユーザ側プロトコル解析部は、 全二重の制御接続に着手しなければならない。サーバ側、ユーザ側 プロセスは、ARPA-Internet Protocol Handbook [1] で指定されている ようなTelnetプロトコルの慣習に従うべきである。サーバは、 コマンドライン編集の機能を提供する義務はなく、それがユーザの ホストで行われることが必要かもしれない。制御接続は、ユーザの 要求があったときに、全ての転送と返答が完了した後にサーバに よって切断されなければならない。 The user-DTP must "listen" on the specified data port; this may be the default user port (U) or a port specified in the PORT command. The server shall initiate the data connection from his own default data port (L-1) using the specified user data port. The direction of the transfer and the port used will be determined by the FTP service command. ユーザ側DTPは指定されたデータポートで「聞き耳を立て」なければ ならない;これは、デフォルトのユーザポート(U)かPORTコマンド で指定されたポートだろう。サーバは、自身のデフォルトのデータ ポート(L-1)から指定されたユーザのデータポートを使って データ接続に着手しなければならない。転送の方向と使用される ポートはFTPサービスコマンドで決定されるだろう。 Note that all FTP implementation must support data transfer using the default port, and that only the USER-PI may initiate the use of non-default ports. 全てのFTP実装が、デフォルトのポートを使ったデータ転送を サポートしなければならないこと、それからユーザ側PIだけが デフォルトでないポートの使用に着手してよいことに注意すること。 When data is to be transferred between two servers, A and B (refer to Figure 2), the user-PI, C, sets up control connections with both server-PI's. One of the servers, say A, is then sent a PASV command telling him to "listen" on his data port rather than initiate a connection when he receives a transfer service command. When the user-PI receives an acknowledgment to the PASV command, which includes the identity of the host and port being listened on, the user-PI then sends A's port, a, to B in a PORT command; a reply is returned. The user-PI may then send the corresponding service commands to A and B. Server B initiates the connection and the transfer proceeds. The command-reply sequence is listed below where the messages are vertically synchronous but horizontally asynchronous: 2つのサーバAとBの間でデータを転送する場合、ユーザ側PI Cは 両方のサーバ側PIとの制御接続を準備する。それから片方のサーバ (これをAとする)に、転送サービスコマンドを受け取った時に 接続に着手するのではなくデータポートで「聞き耳を立てて」いる ように告げるために、PASVコマンドを送る。ユーザ側PIがPASV コマンドの認知を受け取った時、それはホストと聞き耳を立てている ポートの身元を含んでいて、それからユーザ側PIはAのポートaを B(これがもう一方のサーバ:訳注)にPORTコマンドで送る; 返答が返される。さらに、ユーザ側PIは適切なサービスコマンドを AとBに送る。サーバBが接続を開始し、転送が始まる。一連の コマンドと返答を下に挙げる。このリストは縦では同期しているが 横は非同期である: Postel & Reynolds [Page 44] RFC 959 October 1985 File Transfer Protocol User-PI - Server A User-PI - Server B ------------------ ------------------ C->A : Connect C->B : Connect C->A : PASV A->C : 227 Entering Passive Mode. A1,A2,A3,A4,a1,a2 C->B : PORT A1,A2,A3,A4,a1,a2 B->C : 200 Okay C->A : STOR C->B : RETR B->A : Connect to HOST-A, PORT-a Figure 3 The data connection shall be closed by the server under the conditions described in the Section on Establishing Data Connections. If the data connection is to be closed following a data transfer where closing the connection is not required to indicate the end-of-file, the server must do so immediately. Waiting until after a new transfer command is not permitted because the user-process will have already tested the data connection to see if it needs to do a "listen"; (remember that the user must "listen" on a closed data port BEFORE sending the transfer request). To prevent a race condition here, the server sends a reply (226) after closing the data connection (or if the connection is left open, a "file transfer completed" reply (250) and the user-PI should wait for one of these replies before issuing a new transfer command). データ接続は、Establishing Data Connectionsの章で述べられた 状況の下で、サーバによって閉じられなければならない。 ファイルの末尾を示すために接続を切る必要のないデータ転送 の後にデータ接続が閉じられる場合、サーバは それをすぐに行わなければならない。次の、新しい転送コマンド を待機することは許されない。なぜなら、ユーザ側プロセスは それが「聞き耳を立てて」いる必要があるかどうかを知るために データ接続を検査しているだろうからである;(この文わからない です:訳注)(ユーザは、転送のリクエストを送る*前に* 閉じたデータポートで「聞き耳を立てて」いなければならない ことを忘れないでほしい)競争が起こることを避けるために、 サーバはデータ接続を閉じた後に応答(226)を送る(あるいは、 もし接続が開いたままなら、「ファイルの転送が完了した」 (250)を送る。ユーザ側PIは新しい転送コマンドを発行する 前にこれらの返答の内のどれかを待っていなければならない)。 Any time either the user or server see that the connection is being closed by the other side, it should promptly read any remaining data queued on the connection and issue the close on its own side. ユーザであれサーバであれ、もう一方が接続を閉じているのに 出会った時はいつでも、それは接続の上に残っている如何なるデータも すみやかに読み、自身の側の接続を閉じるべきである。 5.3. COMMANDS The commands are Telnet character strings transmitted over the control connections as described in the Section on FTP Commands. The command functions and semantics are described in the Section on Access Control Commands, Transfer Parameter Commands, FTP Service Commands, and Miscellaneous Commands. The command syntax is specified here. コマンドとは、FTP Commandsの章で述べた通り、制御接続を介して 伝送されるTelnet文字列である。コマンドの機能と意味は、Access Control Commands、Transfer Parameter Commands、FTP Service CommandsとMiscellaneous Commandsの章で述べた。コマンドの 構文をここに示す。 The commands begin with a command code followed by an argument field. The command codes are four or fewer alphabetic characters. Upper and lower case alphabetic characters are to be treated identically. Thus, any of the following may represent the retrieve command: コマンドはコマンドコードで始まり、続いて引数のフィールドがある。 コマンドコードは4つかそれ以下のアルファベット文字である。 大文字と小文字は、同じものであるとみなされる。したがって、以下の どれもが確保コマンドを表現している: Postel & Reynolds [Page 45] RFC 959 October 1985 File Transfer Protocol RETR Retr retr ReTr rETr This also applies to any symbols representing parameter values, such as A or a for ASCII TYPE. The command codes and the argument fields are separated by one or more spaces. これは、ASCIIタイプの場合のAやaのように、パラメータ値を表現する どんな文字にも適用する。コマンドコードと引数フィールドは1つ以上 の空白で分割される。 The argument field consists of a variable length character string ending with the character sequence (Carriage Return, Line Feed) for NVT-ASCII representation; for other negotiated languages a different end of line character might be used. It should be noted that the server is to take no action until the end of line code is received. 引数フィールドは、NVT-ASCIIの表現の(復帰改行)の 綴りで終わる様々な長さの文字列から成る;協議の結果として 他の言語を使っている場合は、異なる行末文字が使われても かまわない。サーバは、行末コードを受け取るまで行動を起こす べきではないことに注意してほしい。 The syntax is specified below in NVT-ASCII. All characters in the argument field are ASCII characters including any ASCII represented decimal integers. Square brackets denote an optional argument field. If the option is not taken, the appropriate default is implied. NVT-ASCIIでの構文を下に示す。引数フィールドのすべての文字は ASCIIで表現された何らかの十進数を含むASCII文字である。 角カッコ(?"[", "]"のこと:訳注)は、オプションの引数変数を 意味する。もしオプションが与えられていなければ、適切な デフォルト値を暗に指定したことになる。 Postel & Reynolds [Page 46] RFC 959 October 1985 File Transfer Protocol 5.3.1. FTP COMMANDS The following are the FTP commands: 下がFTPコマンドである: USER PASS ACCT CWD CDUP SMNT QUIT REIN PORT PASV TYPE STRU MODE RETR STOR STOU APPE ALLO [ R ] REST RNFR RNTO ABOR DELE RMD MKD PWD LIST [ ] NLST [ ] SITE SYST STAT [ ] HELP [ ] NOOP Postel & Reynolds [Page 47] RFC 959 October 1985 File Transfer Protocol 5.3.2. FTP COMMAND ARGUMENTS The syntax of the above argument fields (using BNF notation where applicable) is: 上の引数変数の構文(適切な場合にはBNF記法を使って)は: ::= ::= ::= ::= | ::= any of the 128 ASCII characters except and 128のASCII文字の内を除くもの ::= ::= | ::= printable characters, any ASCII code 33 through 126 印刷可能文字、ASCIIの33から126 ::= ::= , ::= ,,, ::= , ::= any decimal integer 1 through 255 1から255までの任意の10進数 ::= N | T | C ::= A [ ] | E [ ] | I | L ::= F | R | P ::= S | B | C ::= ::= any decimal integer 任意の10進数 Postel & Reynolds [Page 48] RFC 959 October 1985 File Transfer Protocol 5.4. SEQUENCING OF COMMANDS AND REPLIES The communication between the user and server is intended to be an alternating dialogue. As such, the user issues an FTP command and the server responds with a prompt primary reply. The user should wait for this initial primary success or failure response before sending further commands. ユーザとサーバの間のやり取りは交互の対話になる。このように、 ユーザはFTPコマンドを発行し、サーバはすぐに主要な返答で 応答する。ユーザは次のコマンドを送る前に、この最初の主要 な成功、失敗の応答を待つべきである。 Certain commands require a second reply for which the user should also wait. These replies may, for example, report on the progress or completion of file transfer or the closing of the data connection. They are secondary replies to file transfer commands. いくつかのコマンドは、ユーザが待たなければならない2番目の 返答を必要とする。例えば、これらの返答は進行具合や ファイル転送の完了、データ接続の切断の報告かもしれない。 これらはファイル転送コマンドの2番目の返答である。 One important group of informational replies is the connection greetings. Under normal circumstances, a server will send a 220 reply, "awaiting input", when the connection is completed. The user should wait for this greeting message before sending any commands. If the server is unable to accept input right away, a 120 "expected delay" reply should be sent immediately and a 220 reply when ready. The user will then know not to hang up if there is a delay. 情報を提供する返答の重要なグループは接続のあいさつである。 普通の状況では、サーバは接続が完了したときに220返答 「入力を待つ」を送るだろう。ユーザはこのあいさつメッセージ を、何かコマンドを送る前に待つべきである。もしサーバが 入力をすぐに受け付けることができない場合、120「延期を希望」 返答がすぐに送られ、準備ができたときに220返答が送られる べきである。こうして、ユーザはもし遅延があったとしても それがハングアップではないと知ることができる。 Spontaneous Replies 自発的返答 Sometimes "the system" spontaneously has a message to be sent to a user (usually all users). For example, "System going down in 15 minutes". There is no provision in FTP for such spontaneous information to be sent from the server to the user. It is recommended that such information be queued in the server-PI and delivered to the user-PI in the next reply (possibly making it a multi-line reply). 時々「システム」は自発的にユーザ(普通すべてのユーザ)に メッセージを送る。例えば、「システムは15分後に落ちる」 である。FTPでは、このような自発的な情報がサーバからユーザに 送られるような用意はない。このような情報はサーバ側PIにキュー され、次の返答(何とかして複数行の返答を使って)でユーザ側 PIに届けられることが推奨される。 The table below lists alternative success and failure replies for each command. These must be strictly adhered to; a server may substitute text in the replies, but the meaning and action implied by the code numbers and by the specific command reply sequence cannot be altered. 下の表は、各コマンドに対する成功あるいは失敗の返答を列挙して いる。これらは厳密に守られなければならない;サーバは 返答に かわりの文章を使ってもよいが、コードナンバーや特定のコマンドの 返答のやり取りで暗示される意味や行動を変更してはならない。 Command-Reply Sequences In this section, the command-reply sequence is presented. Each command is listed with its possible replies; command groups are listed together. Preliminary replies are listed first (with their succeeding replies indented and under them), then positive and negative completion, and finally intermediary Postel & Reynolds [Page 49] RFC 959 October 1985 File Transfer Protocol replies with the remaining commands from the sequence following. This listing forms the basis for the state diagrams, which will be presented separately. この章では、コマンドと返答の連続を紹介する。コマンドが その返答としてあり得る物と一緒に列挙されている;コマンド グループも一緒に列挙されている。予備段階の応答が最初に (成功の返答はインデントしてその下に)、次に肯定的または 否定的な完了、最後に中間的な返答を後に続くコマンドと共に 列挙している。このリストは状況図の基礎を形成し、それは 別に紹介される。 Connection Establishment 120 220 220 421 Login USER 230 530 500, 501, 421 331, 332 PASS 230 202 530 500, 501, 503, 421 332 ACCT 230 202 530 500, 501, 503, 421 CWD 250 500, 501, 502, 421, 530, 550 CDUP 200 500, 501, 502, 421, 530, 550 SMNT 202, 250 500, 501, 502, 421, 530, 550 Logout REIN 120 220 220 421 500, 502 QUIT 221 500 Postel & Reynolds [Page 50] RFC 959 October 1985 File Transfer Protocol Transfer parameters PORT 200 500, 501, 421, 530 PASV 227 500, 501, 502, 421, 530 MODE 200 500, 501, 504, 421, 530 TYPE 200 500, 501, 504, 421, 530 STRU 200 500, 501, 504, 421, 530 File action commands ALLO 200 202 500, 501, 504, 421, 530 REST 500, 501, 502, 421, 530 350 STOR 125, 150 (110) 226, 250 425, 426, 451, 551, 552 532, 450, 452, 553 500, 501, 421, 530 STOU 125, 150 (110) 226, 250 425, 426, 451, 551, 552 532, 450, 452, 553 500, 501, 421, 530 RETR 125, 150 (110) 226, 250 425, 426, 451 450, 550 500, 501, 421, 530 Postel & Reynolds [Page 51] RFC 959 October 1985 File Transfer Protocol LIST 125, 150 226, 250 425, 426, 451 450 500, 501, 502, 421, 530 NLST 125, 150 226, 250 425, 426, 451 450 500, 501, 502, 421, 530 APPE 125, 150 (110) 226, 250 425, 426, 451, 551, 552 532, 450, 550, 452, 553 500, 501, 502, 421, 530 RNFR 450, 550 500, 501, 502, 421, 530 350 RNTO 250 532, 553 500, 501, 502, 503, 421, 530 DELE 250 450, 550 500, 501, 502, 421, 530 RMD 250 500, 501, 502, 421, 530, 550 MKD 257 500, 501, 502, 421, 530, 550 PWD 257 500, 501, 502, 421, 550 ABOR 225, 226 500, 501, 502, 421 Postel & Reynolds [Page 52] RFC 959 October 1985 File Transfer Protocol Informational commands SYST 215 500, 501, 502, 421 STAT 211, 212, 213 450 500, 501, 502, 421, 530 HELP 211, 214 500, 501, 502, 421 Miscellaneous commands SITE 200 202 500, 501, 530 NOOP 200 500 421 Postel & Reynolds [Page 53] RFC 959 October 1985 File Transfer Protocol 6. STATE DIAGRAMS Here we present state diagrams for a very simple minded FTP implementation. Only the first digit of the reply codes is used. There is one state diagram for each group of FTP commands or command sequences. ここでは、とても単純に考えたFTP実装の状況図を紹介する。 返答コードの最初の10進数値だけが使われる。FTPコマンド や一連のコマンドのグループそれぞれに1つの状況図がある。 The command groupings were determined by constructing a model for each command then collecting together the commands with structurally identical models. コマンドのグループ化は、それぞれのコマンドについてモデルを 組み立て、それから構造的に同一のモデルを持ったコマンド同士 を集めた。 For each command or command sequence there are three possible outcomes: success (S), failure (F), and error (E). In the state diagrams below we use the symbol B for "begin", and the symbol W for "wait for reply". それぞれのコマンドあるいは一連のコマンドについて、3つの 結果があり得る:成功(S)、失敗(F)、エラー(E)。 下の状況図で、私たちは「開始」のマークにBを、「返答待ち」の マークにWを使う。 We first present the diagram that represents the largest group of FTP commands: 最初にFTPコマンドの最も大きなグループについて表している図を 紹介しよう: 1,3 +---+ ----------->| E | | +---+ | +---+ cmd +---+ 2 +---+ | B |---------->| W |---------->| S | +---+ +---+ +---+ | | 4,5 +---+ ----------->| F | +---+ This diagram models the commands: この図がモデル化しているコマンドは: ABOR, ALLO, DELE, CWD, CDUP, SMNT, HELP, MODE, NOOP, PASV, QUIT, SITE, PORT, SYST, STAT, RMD, MKD, PWD, STRU, and TYPE. Postel & Reynolds [Page 54] RFC 959 October 1985 File Transfer Protocol The other large group of commands is represented by a very similar diagram: 他の大きなコマンドグループはとても似ている図で表せる: 3 +---+ ----------->| E | | +---+ | +---+ cmd +---+ 2 +---+ | B |---------->| W |---------->| S | +---+ --->+---+ +---+ | | | | | | 4,5 +---+ | 1 | ----------->| F | ----- +---+ This diagram models the commands: この図がモデル化しているコマンドは: APPE, LIST, NLST, REIN, RETR, STOR, and STOU. Note that this second model could also be used to represent the first group of commands, the only difference being that in the first group the 100 series replies are unexpected and therefore treated as error, while the second group expects (some may require) 100 series replies. Remember that at most, one 100 series reply is allowed per command. この2番目のモデルは最初のコマンドグループを表現するのにも使える ことに注意してほしい。最初のグループでは100代の返答は予期されて おらず、したがってエラーとして扱われるが、2番目のグループは 100代の返答を予期する(いくつかは必要とするかもしれない)。 1つのコマンドに対して最大で1つの100代の返答が許されることを 忘れてはいけない。 The remaining diagrams model command sequences, perhaps the simplest of these is the rename sequence: 残っている図は連続したコマンドをモデル化していて、たぶん一番簡単 なのは名前変更の物である: +---+ RNFR +---+ 1,2 +---+ | B |---------->| W |---------->| E | +---+ +---+ -->+---+ | | | 3 | | 4,5 | -------------- ------ | | | | +---+ | ------------->| S | | | 1,3 | | +---+ | 2| -------- | | | | V | | | +---+ RNTO +---+ 4,5 ----->+---+ | |---------->| W |---------->| F | +---+ +---+ +---+ Postel & Reynolds [Page 55] RFC 959 October 1985 File Transfer Protocol The next diagram is a simple model of the Restart command: 次の図は再開コマンドの簡単なモデルである: +---+ REST +---+ 1,2 +---+ | B |---------->| W |---------->| E | +---+ +---+ -->+---+ | | | 3 | | 4,5 | -------------- ------ | | | | +---+ | ------------->| S | | | 3 | | +---+ | 2| -------- | | | | V | | | +---+ cmd +---+ 4,5 ----->+---+ | |---------->| W |---------->| F | +---+ -->+---+ +---+ | | | 1 | ------ Where "cmd" is APPE, STOR, or RETR. 「cmd」の所はAPPE、STORかRETRである。 We note that the above three models are similar. The Restart differs from the Rename two only in the treatment of 100 series replies at the second stage, while the second group expects (some may require) 100 series replies. Remember that at most, one 100 series reply is allowed per command. 上の3つのモデルは似通っていると記しておく。再開と名前変更の 相違点はたった1つで、第2段階での100代の返答の扱いで、2番目 のグループは100代の返答を予期(いくつかのものは必要とするかも しれない)していることである。1つのコマンドにつきせいぜい1回 の100代返答が許されていることを覚えておいてほしい。 Postel & Reynolds [Page 56] RFC 959 October 1985 File Transfer Protocol The most complicated diagram is for the Login sequence: 最も複雑な図はログインシーケンスのための物である: 1 +---+ USER +---+------------->+---+ | B |---------->| W | 2 ---->| E | +---+ +---+------ | -->+---+ | | | | | 3 | | 4,5 | | | -------------- ----- | | | | | | | | | | | | | | --------- | | 1| | | | V | | | | +---+ PASS +---+ 2 | ------>+---+ | |---------->| W |------------->| S | +---+ +---+ ---------->+---+ | | | | | 3 | |4,5| | | -------------- -------- | | | | | | | | | | | | ----------- | 1,3| | | | V | 2| | | +---+ ACCT +---+-- | ----->+---+ | |---------->| W | 4,5 -------->| F | +---+ +---+------------->+---+ Postel & Reynolds [Page 57] RFC 959 October 1985 File Transfer Protocol Finally, we present a generalized diagram that could be used to model the command and reply interchange: 最後に、コマンドと返答のやり取りをモデル化するのに使える、 一括化された図を紹介しよう: ------------------------------------ | | Begin | | | V | | +---+ cmd +---+ 2 +---+ | -->| |------->| |---------->| | | | | | W | | S |-----| -->| | -->| |----- | | | | +---+ | +---+ 4,5 | +---+ | | | | | | | | | | | 1| |3 | +---+ | | | | | | | | | | | | ---- | ---->| F |----- | | | | | | | | +---+ ------------------- | | V End Postel & Reynolds [Page 58] RFC 959 October 1985 File Transfer Protocol 7. TYPICAL FTP SCENARIO User at host U wanting to transfer files to/from host S: ホストS から/に ファイルを転送しようとしているホストUのユーザ: In general, the user will communicate to the server via a mediating user-FTP process. The following may be a typical scenario. The user-FTP prompts are shown in parentheses, '---->' represents commands from host U to host S, and '<----' represents replies from host S to host U. 一般的に、ユーザはユーザ側FTPプロセスを通してサーバとやり取り を行うだろう。下にあるのは、典型的なシナリオである。ユーザ側 FTPのプロンプトがカッコの中に示されていて、'---->'はホストUから ホストSへのコマンドを表していて、'<----'はホストSからホストUへの 返答を表している。 LOCAL COMMANDS BY USER ACTION INVOLVED ftp (host) multics Connect to host S, port L, establishing control connections. <---- 220 Service ready . username Doe USER Doe----> <---- 331 User name ok, need password. password mumble PASS mumble----> <---- 230 User logged in. retrieve (local type) ASCII (local pathname) test 1 User-FTP opens local file in ASCII. (for. pathname) test.pl1 RETR test.pl1 ----> <---- 150 File status okay; about to open data connection. Server makes data connection to port U. <---- 226 Closing data connection, file transfer successful. type Image TYPE I ----> <---- 200 Command OK store (local type) image (local pathname) file dump User-FTP opens local file in Image. (for.pathname) >udd>cn>fd STOR >udd>cn>fd ----> <---- 550 Access denied terminate QUIT ----> Server closes all connections. 8. CONNECTION ESTABLISHMENT The FTP control connection is established via TCP between the user process port U and the server process port L. This protocol is assigned the service port 21 (25 octal), that is L=21. FTPの制御接続は、ユーザプロセスのポートUとサーバプロセスの ポートLの間にTCPを介して構築される。このプロトコルはサービス ポートに21(8進数の25)を割り当てる。つまりL=21である。 Postel & Reynolds [Page 59] RFC 959 October 1985 File Transfer Protocol APPENDIX I - PAGE STRUCTURE The need for FTP to support page structure derives principally from the need to support efficient transmission of files between TOPS-20 systems, particularly the files used by NLS. FTPがページ構造をサポートする必要性は主にTOPS-20のシステム 間、特にNLSに使われるファイルで効率の良い転送をサポートする 必要性から生じた。 The file system of TOPS-20 is based on the concept of pages. The operating system is most efficient at manipulating files as pages. The operating system provides an interface to the file system so that many applications view files as sequential streams of characters. However, a few applications use the underlying page structures directly, and some of these create holey files. TOPS-20のファイルシステムはページの概念に基づいている。 オペレーティングシステムはファイルをページとして扱う時にもっとも 効果的である。オペレーティングシステムは、多くのアプリケーション がファイルを文字の連続した流れとして見ることができるように ファイルシステムへのインターフェイスを提供している。だが、 基本となるページ構造を使つアプリケーションは少ないながらも 存在し、それらの内のいくつかは穴ぼこの空いたファイルを作る。 A TOPS-20 disk file consists of four things: a pathname, a page table, a (possibly empty) set of pages, and a set of attributes. TOPS-20のディスクのファイルは4つの物からなる:パス名、 ページ表、ページの集合(空でもよい)と属性の集合である。 The pathname is specified in the RETR or STOR command. It includes the directory name, file name, file name extension, and generation number. パス名はRETRやSTORコマンドで指定される。これはディレクトリ名 やファイル名、ファイル名の拡張子と製造番号を含んでいる。 The page table contains up to 2**18 entries. Each entry may be EMPTY, or may point to a page. If it is not empty, there are also some page-specific access bits; not all pages of a file need have the same access protection. ページ表は2の18乗までのエントリを持つ。それぞれのエントリ は*空*でもよいし、ページを指していてもよい。もしそれが 空でないなら、それはページ特有のアクセスビットも持つ;ファイル の全てのページが同じアクセス保護を持つ必要はない。 A page is a contiguous set of 512 words of 36 bits each. ページは、それぞれ36ビットからなる512ワードの 連続した集合である。 The attributes of the file, in the File Descriptor Block (FDB), contain such things as creation time, write time, read time, writer's byte-size, end-of-file pointer, count of reads and writes, backup system tape numbers, etc. ファイルの属性は、ファイル記述子のブロック(FDB)にあり、 作成時刻、書き込み時刻、読込み時刻、書き込み側のバイトサイズ (?writer's byte-size:訳注)、ファイル末のポインタ、読み書き の回数、バックアップシステムのテープ番号などを持っている。 Note that there is NO requirement that entries in the page table be contiguous. There may be empty page table slots between occupied ones. Also, the end of file pointer is simply a number. There is no requirement that it in fact point at the "last" datum in the file. Ordinary sequential I/O calls in TOPS-20 will cause the end of file pointer to be left after the last datum written, but other operations may cause it not to be so, if a particular programming system so requires. ページ表にあるエントリが連続している必要性は*無い*ことに 注意してほしい。内容のある物の中に、空のページ表スロットが あってもかまわない。また、ファイル末のポインタは単なる数字 である。それが実際にファイルの「最後の」データを指し示して いる必要はない。普通の連続的なI/Oの呼び出しは、TOPS-20では ファイル末ポインタが最後のデータが書かれる後まで(書かれず に:訳注)残っている原因となるが、もし特定のプログラミング システムがそうしないなら、他の操作ではそうならないかもしれない。 In fact, in both of these special cases, "holey" files and end-of-file pointers NOT at the end of the file, occur with NLS data files. 事実、これらの特別な場合の両方で、「穴ぼこ」ファイルと ファイルの末尾にないファイル末のポインタは、NLSのデータ ファイルで起こる。 Postel & Reynolds [Page 60] RFC 959 October 1985 File Transfer Protocol The TOPS-20 paged files can be sent with the FTP transfer parameters: TYPE L 36, STRU P, and MODE S (in fact, any mode could be used). TOP-20のページファイルは、TYPE L 36、STRU P、MODE S(実際は どのモードも使える)のFTP転送パラメータで送れる。 Each page of information has a header. Each header field, which is a logical byte, is a TOPS-20 word, since the TYPE is L 36. 各ページ情報はヘッダを持つ。TYPE L 36 としたので、それぞれの ヘッダ属性は、1論理バイト、1つのTOPS-20ワードである。 The header fields are: ヘッダ属性は: Word 0: Header Length. ワード0:ヘッダの長さ。 The header length is 5. ヘッダの長さは5である。 Word 1: Page Index. ワード1:ページ索引。 If the data is a disk file page, this is the number of that page in the file's page map. Empty pages (holes) in the file are simply not sent. Note that a hole is NOT the same as a page of zeros. もしデータがディスクファイルのページなら、これは そのファイルのページ表でのそのページの数字である。 ファイルの空の(穴)ページはただ送られない。この穴は 0のページと同じでは*ない*ことに注意すること。 Word 2: Data Length. ワード2:データの長さ。 The number of data words in this page, following the header. Thus, the total length of the transmission unit is the Header Length plus the Data Length. このページでの、ヘッダの後に続くデータワードの数。 したがって、伝送ユニット全体の長さはヘッダの長さと データの長さの和である。 Word 3: Page Type. ワード3:ページタイプ。 A code for what type of chunk this is. A data page is type 3, the FDB page is type 2. これがどのタイプのデータかを示すコード。データページは タイプ3、FDBページはタイプ2である。 Word 4: Page Access Control. ワード4:ページのアクセス制御情報。 The access bits associated with the page in the file's page map. (This full word quantity is put into AC2 of an SPACS by the program reading from net to disk.) ファイルのページマップの中で、ページと関連したアクセス ビット。(下の方の文わかりません:訳注) After the header are Data Length data words. Data Length is currently either 512 for a data page or 31 for an FDB. Trailing zeros in a disk file page may be discarded, making Data Length less than 512 in that case. ヘッダの後は、Data Lengthの長さのデータワードである。 Data Lengthは現在、データページのための512かFDBのための 31のどちらかである。ディスクファイルページの中の跡について いる0は、その場合Data Lengthを512より小さくするために 捨てられてもかまわない。 Postel & Reynolds [Page 61] RFC 959 October 1985 File Transfer Protocol APPENDIX II - DIRECTORY COMMANDS Since UNIX has a tree-like directory structure in which directories are as easy to manipulate as ordinary files, it is useful to expand the FTP servers on these machines to include commands which deal with the creation of directories. Since there are other hosts on the ARPA-Internet which have tree-like directories (including TOPS-20 and Multics), these commands are as general as possible. UNIXは、通常ファイルと同じように簡単にディレクトリを扱うこと ができる木のようなディレクトリ構造を持っているので、このような マシン上のFTPサーバがディレクトリの作成を扱うコマンドを搭載 するように拡張するのは有益である。ARPA-Internetには、木の ようなディレクトリを持つ他のホスト(TOPS-20やMulticsを含む) もあるので、これらのコマンドは出来る限り一般的にする。 Four directory commands have been added to FTP: 4つのディレクトリコマンドがFTPに追加された: MKD pathname Make a directory with the name "pathname". "pathname"という名前のディレクトリを作る。 RMD pathname Remove the directory with the name "pathname". "pathname"という名前のディレクトリを削除する。 PWD Print the current working directory name. 現在のワーキングディレクトリを印刷する。 CDUP Change to the parent of the current working directory. 現在のワーキングディレクトリの親に変える。 The "pathname" argument should be created (removed) as a subdirectory of the current working directory, unless the "pathname" string contains sufficient information to specify otherwise to the server, e.g., "pathname" is an absolute pathname (in UNIX and Multics), or pathname is something like "" to TOPS-20. "pathname"引数は、その文字列がそれ以外の物を指すのに充分な 情報を含んでいない限り、つまり、(UNIXやMulticsでは)"pathname" が絶対パスだったり、TOPS-20での""みたいな ものでない限り、現在のワーキングディレクトリのサブディレクトリ として作成(削除)されるべきである。 REPLY CODES The CDUP command is a special case of CWD, and is included to simplify the implementation of programs for transferring directory trees between operating systems having different syntaxes for naming the parent directory. The reply codes for CDUP be identical to the reply codes of CWD. CDUPコマンドはCWDの特別な場合で、親ディレクトリの呼び 方に異なる構文を持つオペレーティングシステム間でディレクトリ 木を転送するプログラムの実装を容易にするために導入される。 CDUPの返答コードはCWDの返答コードと同一である。 The reply codes for RMD be identical to the reply codes for its file analogue, DELE. RMDの返答コードは、そのファイル版であるDELEの返答コード と同一である。 The reply codes for MKD, however, are a bit more complicated. A freshly created directory will probably be the object of a future Postel & Reynolds [Page 62] RFC 959 October 1985 File Transfer Protocol CWD command. Unfortunately, the argument to MKD may not always be a suitable argument for CWD. This is the case, for example, when a TOPS-20 subdirectory is created by giving just the subdirectory name. That is, with a TOPS-20 server FTP, the command sequence しかし、MKDの返答コードは少し複雑になる。新しく作られた ディレクトリはたぶん将来のCWDコマンドの対象になるだろう。 残念ながら、MKDの引数がいつでもCWDの引数に適当であるわけ ではない。例えば、TOPS-20のサブディレクトリがその名前を 与えるだけで作成されるような場合である。つまり、TOPS-20の サーバFTPでは、一連のコマンド MKD MYDIR CWD MYDIR will fail. The new directory may only be referred to by its "absolute" name; e.g., if the MKD command above were issued while connected to the directory , the new subdirectory could only be referred to by the name . は失敗するだろう。新しいディレクトリは、その「絶対」名で だけ参照することができる;つまり、もし上のMKDコマンドが ディレクトリに接続されている間に発行された なら、新しいサブディレクトリはという 名前でだけ参照できる。 Even on UNIX and Multics, however, the argument given to MKD may not be suitable. If it is a "relative" pathname (i.e., a pathname which is interpreted relative to the current directory), the user would need to be in the same current directory in order to reach the subdirectory. Depending on the application, this may be inconvenient. It is not very robust in any case. しかしUNIXやMultics上ですら、MKDに与えられた引数が適当では ないかもしれない。もしそれが「相対」パス名(つまり、 現在のディレクトリに相対して解釈されるパス名)だったら、 ユーザは、サブディレクトリに到達するためには、同じカレント ディレクトリにいる必要があるだろう。アプリケーションに よっては、これは不便かもしれない。これはどの場合においても それほど強くはない。 To solve these problems, upon successful completion of an MKD command, the server should return a line of the form: これらの問題を解決、MKDコマンドの成功して完了するため、 サーバはこの形式の行を返すべきである。 257"" That is, the server will tell the user what string to use when referring to the created directory. The directory name can contain any character; embedded double-quotes should be escaped by double-quotes (the "quote-doubling" convention). つまり、サーバは作成されたディレクトリを参照する時に使う 文字列をユーザに知らせる。ディレクトリ名はどんな文字を 含んでもかまわない;ダブルクオートが埋め込まれている場合、 ダブルクオートで外に出なければならない("ダブルクオート" の習慣)。 For example, a user connects to the directory /usr/dm, and creates a subdirectory, named pathname: 例えば、ユーザが/usr/dmディレクトリに接続し、サブディレクトリ を作る、そのパス名は: CWD /usr/dm 200 directory changed to /usr/dm MKD pathname 257 "/usr/dm/pathname" directory created An example with an embedded double quote: ダブルクオート埋込の例: MKD foo"bar 257 "/usr/dm/foo""bar" directory created CWD /usr/dm/foo"bar 200 directory changed to /usr/dm/foo"bar Postel & Reynolds [Page 63] RFC 959 October 1985 File Transfer Protocol The prior existence of a subdirectory with the same name is an error, and the server must return an "access denied" error reply in that case. 同じ名前のサブディレクトリが先に存在する場合はエラーになり、 その場合サーバは「アクセス拒否」エラー返答を返さなければ ならない。 CWD /usr/dm 200 directory changed to /usr/dm MKD pathname 521-"/usr/dm/pathname" directory already exists; 521 taking no action. The failure replies for MKD are analogous to its file creating cousin, STOR. Also, an "access denied" return is given if a file name with the same name as the subdirectory will conflict with the creation of the subdirectory (this is a problem on UNIX, but shouldn't be one on TOPS-20). MKDの失敗返答は、ファイル作成の親戚であるSTORに似ている。 また、もしサブディレクトリと同じ名前のファイル名が サブディレクトリの作成と衝突する時(これはUNIXでの 問題である、 TOPS-20ではそうではない)も「アクセス拒否」の返答が与えられる。 Essentially because the PWD command returns the same type of information as the successful MKD command, the successful PWD command uses the 257 reply code as well. 本質的にPWDコマンドは、成功したMKDコマンドと同じ種類の 情報を返すので、成功したPWDコマンドも同様に257返答コードを 使う。 SUBTLETIES 微妙なこと(??:訳注) Because these commands will be most useful in transferring subtrees from one machine to another, carefully observe that the argument to MKD is to be interpreted as a sub-directory of the current working directory, unless it contains enough information for the destination host to tell otherwise. A hypothetical example of its use in the TOPS-20 world: これらのコマンドはあるマシンから他のマシンに部分木を 転送する場合に最も有用であろうから、MKDの引数は、それが 行き先のホストが他の物と見分けるのに充分な情報を含んで いるのでなければ、現在のワーキングディレクトリの サブディレクトリであると解釈されるべきであるということを 注意深く見取ってほしい。TOPS-20の世界でのその使用の 想像上の例: CWD 200 Working directory changed MKD overrainbow 257 "" directory created CWD overrainbow 431 No such directory CWD 200 Working directory changed CWD 200 Working directory changed to MKD 257 "" directory created CWD Note that the first example results in a subdirectory of the connected directory. In contrast, the argument in the second example contains enough information for TOPS-20 to tell that the Postel & Reynolds [Page 64] RFC 959 October 1985 File Transfer Protocol directory is a top-level directory. Note also that in the first example the user "violated" the protocol by attempting to access the freshly created directory with a name other than the one returned by TOPS-20. Problems could have resulted in this case had there been an directory; this is an ambiguity inherent in some TOPS-20 implementations. Similar considerations apply to the RMD command. The point is this: except where to do so would violate a host's conventions for denoting relative versus absolute pathnames, the host should treat the operands of the MKD and RMD commands as subdirectories. The 257 reply to the MKD command must always contain the absolute pathname of the created directory. 最初の例が接続したディレクトリのサブディレクトリを作っている ことに注意してほしい。対照的に、2番目の例の引数はTOPS-20で ディレクトリがトップレベルのディレクトリである ことを示すのに充分な情報を含んでいる。最初の例で、ユーザが 新しく作られたディレクトリにTOPS-20に返された名前とは違う 名前でアクセスしようとしてプロトコルを「脅かして」いることにも 注意してほしい。Problems could have resulted in this case had there been an directory(この文わかりません: 訳注);これはTOPS-20の実装に固有のあいまいさである。 同じことがRMDコマンドにも当て嵌まる。ポイントはここである: そうすることが相対パス名と絶対パス名を意味することのための ホストの習慣を脅かすような場合を除いて、ホストはMKDとRMD コマンドの引数をサブディレクトリとして扱うべきである。 MKDコマンドに対する257返答は、作成されたディレクトリの絶対 パス名を常に含んでいなければならない。 Postel & Reynolds [Page 65] RFC 959 October 1985 File Transfer Protocol APPENDIX III - RFCs on FTP Bhushan, Abhay, "A File Transfer Protocol", RFC 114 (NIC 5823), MIT-Project MAC, 16 April 1971. Harslem, Eric, and John Heafner, "Comments on RFC 114 (A File Transfer Protocol)", RFC 141 (NIC 6726), RAND, 29 April 1971. Bhushan, Abhay, et al, "The File Transfer Protocol", RFC 172 (NIC 6794), MIT-Project MAC, 23 June 1971. Braden, Bob, "Comments on DTP and FTP Proposals", RFC 238 (NIC 7663), UCLA/CCN, 29 September 1971. Bhushan, Abhay, et al, "The File Transfer Protocol", RFC 265 (NIC 7813), MIT-Project MAC, 17 November 1971. McKenzie, Alex, "A Suggested Addition to File Transfer Protocol", RFC 281 (NIC 8163), BBN, 8 December 1971. Bhushan, Abhay, "The Use of "Set Data Type" Transaction in File Transfer Protocol", RFC 294 (NIC 8304), MIT-Project MAC, 25 January 1972. Bhushan, Abhay, "The File Transfer Protocol", RFC 354 (NIC 10596), MIT-Project MAC, 8 July 1972. Bhushan, Abhay, "Comments on the File Transfer Protocol (RFC 354)", RFC 385 (NIC 11357), MIT-Project MAC, 18 August 1972. Hicks, Greg, "User FTP Documentation", RFC 412 (NIC 12404), Utah, 27 November 1972. Bhushan, Abhay, "File Transfer Protocol (FTP) Status and Further Comments", RFC 414 (NIC 12406), MIT-Project MAC, 20 November 1972. Braden, Bob, "Comments on File Transfer Protocol", RFC 430 (NIC 13299), UCLA/CCN, 7 February 1973. Thomas, Bob, and Bob Clements, "FTP Server-Server Interaction", RFC 438 (NIC 13770), BBN, 15 January 1973. Braden, Bob, "Print Files in FTP", RFC 448 (NIC 13299), UCLA/CCN, 27 February 1973. McKenzie, Alex, "File Transfer Protocol", RFC 454 (NIC 14333), BBN, 16 February 1973. Postel & Reynolds [Page 66] RFC 959 October 1985 File Transfer Protocol Bressler, Bob, and Bob Thomas, "Mail Retrieval via FTP", RFC 458 (NIC 14378), BBN-NET and BBN-TENEX, 20 February 1973. Neigus, Nancy, "File Transfer Protocol", RFC 542 (NIC 17759), BBN, 12 July 1973. Krilanovich, Mark, and George Gregg, "Comments on the File Transfer Protocol", RFC 607 (NIC 21255), UCSB, 7 January 1974. Pogran, Ken, and Nancy Neigus, "Response to RFC 607 - Comments on the File Transfer Protocol", RFC 614 (NIC 21530), BBN, 28 January 1974. Krilanovich, Mark, George Gregg, Wayne Hathaway, and Jim White, "Comments on the File Transfer Protocol", RFC 624 (NIC 22054), UCSB, Ames Research Center, SRI-ARC, 28 February 1974. Bhushan, Abhay, "FTP Comments and Response to RFC 430", RFC 463 (NIC 14573), MIT-DMCG, 21 February 1973. Braden, Bob, "FTP Data Compression", RFC 468 (NIC 14742), UCLA/CCN, 8 March 1973. Bhushan, Abhay, "FTP and Network Mail System", RFC 475 (NIC 14919), MIT-DMCG, 6 March 1973. Bressler, Bob, and Bob Thomas "FTP Server-Server Interaction - II", RFC 478 (NIC 14947), BBN-NET and BBN-TENEX, 26 March 1973. White, Jim, "Use of FTP by the NIC Journal", RFC 479 (NIC 14948), SRI-ARC, 8 March 1973. White, Jim, "Host-Dependent FTP Parameters", RFC 480 (NIC 14949), SRI-ARC, 8 March 1973. Padlipsky, Mike, "An FTP Command-Naming Problem", RFC 506 (NIC 16157), MIT-Multics, 26 June 1973. Day, John, "Memo to FTP Group (Proposal for File Access Protocol)", RFC 520 (NIC 16819), Illinois, 25 June 1973. Merryman, Robert, "The UCSD-CC Server-FTP Facility", RFC 532 (NIC 17451), UCSD-CC, 22 June 1973. Braden, Bob, "TENEX FTP Problem", RFC 571 (NIC 18974), UCLA/CCN, 15 November 1973. Postel & Reynolds [Page 67] RFC 959 October 1985 File Transfer Protocol McKenzie, Alex, and Jon Postel, "Telnet and FTP Implementation - Schedule Change", RFC 593 (NIC 20615), BBN and MITRE, 29 November 1973. Sussman, Julie, "FTP Error Code Usage for More Reliable Mail Service", RFC 630 (NIC 30237), BBN, 10 April 1974. Postel, Jon, "Revised FTP Reply Codes", RFC 640 (NIC 30843), UCLA/NMC, 5 June 1974. Harvey, Brian, "Leaving Well Enough Alone", RFC 686 (NIC 32481), SU-AI, 10 May 1975. Harvey, Brian, "One More Try on the FTP", RFC 691 (NIC 32700), SU-AI, 28 May 1975. Lieb, J., "CWD Command of FTP", RFC 697 (NIC 32963), 14 July 1975. Harrenstien, Ken, "FTP Extension: XSEN", RFC 737 (NIC 42217), SRI-KL, 31 October 1977. Harrenstien, Ken, "FTP Extension: XRSQ/XRCP", RFC 743 (NIC 42758), SRI-KL, 30 December 1977. Lebling, P. David, "Survey of FTP Mail and MLFL", RFC 751, MIT, 10 December 1978. Postel, Jon, "File Transfer Protocol Specification", RFC 765, ISI, June 1980. Mankins, David, Dan Franklin, and Buzz Owen, "Directory Oriented FTP Commands", RFC 776, BBN, December 1980. Padlipsky, Michael, "FTP Unique-Named Store Command", RFC 949, MITRE, July 1985. Postel & Reynolds [Page 68] RFC 959 October 1985 File Transfer Protocol REFERENCES [1] Feinler, Elizabeth, "Internet Protocol Transition Workbook", Network Information Center, SRI International, March 1982. [2] Postel, Jon, "Transmission Control Protocol - DARPA Internet Program Protocol Specification", RFC 793, DARPA, September 1981. [3] Postel, Jon, and Joyce Reynolds, "Telnet Protocol Specification", RFC 854, ISI, May 1983. [4] Reynolds, Joyce, and Jon Postel, "Assigned Numbers", RFC 943, ISI, April 1985. Postel & Reynolds [Page 69]