FSExtras.mesa
Created by M. D. Schroeder, November 15, 1983 9:55 am
Edit history:
MDS @ November 15, 1983 9:57 am
MDS @ November 28, 1983 10:15 am
DIRECTORY
BasicTime USING [GMT, nullGMT],
IO USING [STREAM],
Rope USING [ROPE];
FSExtras contains items which will be added to FS and/or FSBackdoor the next time those interfaces can be recompiled.
FSExtras: CEDAR DEFINITIONS = BEGIN
The following item will replace the Copy procedure from the FS interface. The only difference is that the full FName of the "to" file created by the copy is returned.
NewCopy: PROC [from, to: Rope.ROPE, setKeep: BOOLEANFALSE, keep: CARDINAL ← 1, wantedCreatedTime: BasicTime.GMT ← BasicTime.nullGMT, remoteCheck: BOOLEANTRUE, attach: BOOLEANFALSE, wDir: Rope.ROPENIL] RETURNS [toFName: Rope.ROPE];
The following item will be added to the stream manipulation procedures in the FS interface.
StreamFromOpenStream: PROC [self: IO.STREAM] RETURNS [IO.STREAM];
Given an existing file stream open for writing (accessRights=$write), creates a new stream on the same file with accessRights=$read. The two streams are then independently positionable, but are internally linked together so that the reader sees data written by the writer. At most one read stream may be linked in this way with any given write stream.
Client errors: $notImplemented
User errors: none
The following items will replace EventOp, EventHandle, EventObject, and NextEvent from FSBackdoor.
RemoteOp: TYPE = {startRetrieving, endRetrieving, startStoring, endStoring, startDeleting, endDeleting, startRenaming, endRenaming, startFlushing, endFlushing};
RemoteEvent: TYPE = RECORD [
op: RemoteOp, -- remote operation that has occurred
fName: Rope.ROPE, -- full GName of the remote file operated upon
chain: REF RemoteEvent -- used internally to chain events together
];
NextRemoteEvent: PROC [REF READONLY RemoteEvent ← NIL] RETURNS [REF READONLY RemoteEvent];
A remote event is the start or conclusion of retrieving, storing, deleting, renaming or flushing (from the cache) a global file. NextRemoteEvent returns the next event that occurs after the argument RemoteEvent. When the argument RemoteEvent is NIL then NextRemoteEvent returns the first event to occur after the time of the call. NextRemoteEvent will WAIT if another event has not occurred yet. Storing, retrieving and flushing of several files can be in progress simultaneously.
Client errors: none
User errors: none
The following items will be added to FSBackdoor.
CreateOp: TYPE = {writeClose, renameTo, copyTo};
CreateEvent: TYPE = RECORD [
op: CreateOp, -- creation operation that has occurred
fName: Rope.ROPE, -- full LName of the local file that has been created
chain: REF CreateEvent -- used internally to chain events together
];
NextCreateEvent: PROC [REF READONLY CreateEvent ← NIL] RETURNS [REF READONLY CreateEvent];
A creation event is the closing of a local file that was open for write (was just created or overwritten), the completion of an FS.Rename call where "to" is an LName, or the completion of an FS.Copy call where "to" is an LName. NextCreateEvent returns the next event that occurs after the argument CreateEvent. When the argument CreateEvent is NIL then NextCreateEvent returns the first event to occur after the time of the call. NextCreateEvent will WAIT if another event has not occurred yet.
Client errors: none
User errors: none
END.