Skip to main content

File Access Protocol and the File Pointer

III. FILE ACCESS PROTOCOL​

The FAP extension to FTP includes 6 new commands and the file pointer. Any implementation requires the file pointer and all six commands. But, as described above, it is not necessary to implement the commands in their full generality.

III.1 THE FILE POINTER​

The file pointer represents an index or address within the file. The units by which the index is measured, is "logical byte size" and does not include any bytes related to transmission or structure. In particular, for transmission mode Stream and structure Record, the EOR and EOF markers are not counted. Local transformations on data must be taken into account. For example, Multics stores CRLF as NL. In this case, NL counts as two ASCII bytes since it was transmitted to or will be sent from Multics as CRLF. If transmission Mode is Image then the logical byte size is taken as the transmission byte size. There are two commands which operate on the file pointer: 1) SETP to move the pointer and 2) GETP to find out where it is at. These are described below in more detail.

The file pointer may take on three classes of values. All may be mapped to some decimal number. The value B represents the beginning of the file (Byte 0). The value E represents the end of the file (or Byte n for a file n bytes long). The byte pointer may also take on any value between 0 and n.

                    A file of n bytes

..........
|----|----|----|----|-----------|----|----|----|----|
^ 1 2 3 4 n-4 n-3 n-2 n-1 ^
| |
0 n
B E

If a file is stored under set of parameters (TYPE, etc.) and operations are attempted on it under different parameters, the server does not guarantee that the information will be valid.