File Handles and Local Transformations
5. There are many applications in which a remote user would like to access several files simultaneously in much the same way as a local user can. FAP as proposed can not support such multiple file access (of course, the user always has the option of going through an ICP to establish another connection with the server). FAP can be extended in a simple way to support multiple file access by including the notion of a "file handle" which is used to specify which file a given FAP command refers to. When the user does:
OPEN R FOO
the server's response would include a handle for FOO which the user would use in subsequent references to FOO. The handle returned would be a string of the server's choice; it might be the file's name (FOO), a small integer, etc. Use of a (server chosen) file handle rather than the complete file name enables the server to respond to FAP commands without incurring the overhead of re-parsing the file name for each command. To illustrate, consider the following sequence which opens a file for reading and one for writing, reads 3 bytes from the first file as data, computes using the data and writes a 2 byte result to the second file:
OPEN R FOO //server returns FH as handle
OPEN W MOO //server returns MH as handle
READ 3 FH //user reads data
//User does some computation on the 3 bytes
WRIT 2 MH //user writes the result
CLOS MH
CLOS FH
Reasonable defaults could be provided with handles: e.g., a FAP command without a handle refers to the same file as the previous command; etc. (The association of a handle with a file is probably better achieved via a separate FAP command rather than as a side effect of the OPEN command; e.g.,
HNDL FOO )
6. It is important to take local transformations into account (page 3 of RFC 520). However, it is equally important to allow a remote user to suppress local transformations, if he wishes, so that he can access the file as it is stored. This would enable a program that manipulates a file to work equally well whether the file is local (and accessed "directly" via system calls) or remote (and accessed "indirectly" via system calls that are "trapped" and transformed into FAP commands which are sent to the remote site).
[ This RFC was put into machine readable form for entry ]
[ into the online RFC archives by Alex McKenzie with ]
[ support from GTE, formerly BBN Corp. 10/99 ]