IFSFile.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Levin - 14-Sep-81 13:43:20
Russ Atkinson, March 7, 1985 2:04:38 pm PST
DIRECTORY
Rope USING [ROPE];
IFSFile: DEFINITIONS = BEGIN OPEN Rope;
Types
FSInstance: TYPE = REF FSObject;
FSObject: TYPE;
FileHandle: TYPE = REF FileObject;
FileObject: TYPE;
OpenOptions: TYPE = {old, oldReadOnly, new, oldOrNew};
Buffer: TYPE = LONG POINTER;
Position: TYPE = LONG CARDINAL;
ByteCount: TYPE = CARDINAL;
Completer: TYPE = PROC [arg: CompleterArg, outcome: Problem];
CompleterArg: TYPE = LONG POINTER TO LONG CARDINAL;
Problem: TYPE = {ok, io, resources, credentials, illegalIO, other};
AccessFailure: TYPE =
{ok, io, notFound, alreadyExists, accessDenied, accessConflict, illegalFileName, other};
FileTime: TYPE = LONG CARDINAL;
defaultTime: FileTime = 0;
Procedures and Signals
Error: ERROR [reason: Problem];
Login: PROC
[server, userName, password, secondaryName, secondaryPassword: ROPENIL]
RETURNS [FSInstance];
UnableToLogin: ERROR [reason: Problem];
Logout: PROC [FSInstance];
Open: PROC
[instance: FSInstance, name: ROPE, options: OpenOptions ← oldReadOnly]
RETURNS [FileHandle];
CantOpen: ERROR [reason: AccessFailure];
Close: PROC [FileHandle];
Abandon: PROC [FileHandle];
Destroy: PROC [FileHandle];
GetLength: PROC [FileHandle] RETURNS [Position];
SetLength: PROC [FileHandle, Position];
StartRead: PROC [FileHandle, Position, ByteCount, Buffer, Completer, CompleterArg];
StartWrite: PROC [FileHandle, Position, ByteCount, Buffer, Completer, CompleterArg];
GetTimes: PROC [FileHandle] RETURNS [read, write, create: FileTime];
SetCreation: PROC [FileHandle, FileTime ← defaultTime];
Initialization/Finalization Procedures
Initialize: PROC;
Finalize: PROC;
END.