Server handles:
ServerHandle: TYPE ~ REF ServerObject;
ServerObject:
TYPE ~
RECORD [
flavor: ATOM,
name: ROPE,
procs: ServerProcs,
data: REF
];
ServerProcs: TYPE ~ REF ServerProcsObject;
ServerProcsObject:
TYPE ~
RECORD [
sweep: SweepProc ← NIL,
validate: ValidateProc,
delete: DeleteProc,
enumerateForInfo: EnumerateForInfoProc,
enumerateForNames: EnumerateForNamesProc,
getInfo: GetInfoProc,
rename: RenameProc,
retrieve: RetrieveProc,
store: StoreProc
];
SweepProc:
TYPE ~
PROC [h: ServerHandle, seconds:
INT];
Called a few times a minute by this package for miscellaneous housekeeping:
ValidateProc:
TYPE ~
PROC [h: ServerHandle]
RETURNS [ok:
BOOL];
Called to validate a handle that might be stale:
The following are called to perform file operations. They should raise appropriate FS.Error's to indicate failure:
DeleteProc: TYPE ~ PROC [h: ServerHandle, file: ROPE, wantedCreatedTime: GMT, proc: ConfirmProc];
EnumerateForInfoProc: TYPE ~ PROC [h: ServerHandle, pattern: ROPE, proc: InfoProc];
EnumerateForNamesProc: TYPE ~ PROC [h: ServerHandle, pattern: ROPE, proc: NameProc];
GetInfoProc:
TYPE ~
PROC [h: ServerHandle, file:
ROPE, wantedCreatedTime:
GMT]
RETURNS [version: Version, bytes: INT, created: GMT, fileType: FileType];
RenameProc: TYPE ~ PROC [h: ServerHandle, fromFile: ROPE, fromCreated: GMT, toFile: ROPE, proc: ConfirmProc];
RetrieveProc: TYPE ~ PROC [h: ServerHandle, file: ROPE, wantedCreatedTime: GMT, proc: ConfirmRetrieveProc, checkFileType: BOOL, fileType: FileType];
StoreProc: TYPE ~ PROC [h: ServerHandle, file: ROPE, str: IO.STREAM, created: GMT, proc: ConfirmProc];
Registration
Register:
PROC [flavor:
ATOM, getServer: GetServerProc];
Register an(other) remote file ops implementation. Any existing registration for "flavor" disappears. "getServer" may be NIL, to clear a registration.
GetServerProc:
TYPE ~
PROC [server:
ROPE]
RETURNS [h: ServerHandle];
Try to find a server of the given name.
Should return NIL if no server responds and no server is known to exist.
Should return an unusable handle (i.e. a handle such that every operation will raise FS.Error) if server is known to exist but is not responding.
Should not raise FS.Error itself!
The caller may Process.Abort this proc.