DIRECTORY BasicTime USING [GMT], IO USING [STREAM], RemoteFile USING [ServerHandle], Rope USING [ROPE], SunNFS USING [FType]; UnixRemoteFile: CEDAR DEFINITIONS ~ { FileDescriptor: TYPE ~ REF; FType: TYPE ~ SunNFS.FType -- { non(0), reg(1), dir(2), blk(3), chr(4), lnk(5) } -- ; GMT: TYPE ~ BasicTime.GMT; Mode: TYPE ~ CARD32 -- rwxrwxrwx, suid, sgid -- ; ROPE: TYPE ~ Rope.ROPE; ServerHandle: TYPE ~ RemoteFile.ServerHandle; STREAM: TYPE ~ IO.STREAM; viewUnix: READONLY ATOM; Handle: TYPE ~ REF Object; Object: TYPE ~ RECORD [ sH: ServerHandle, procs: UnixServerProcs ]; UnixServerProcs: TYPE ~ REF UnixServerProcsObject; UnixServerProcsObject: TYPE ~ RECORD [ open: OpenProc, close: CloseProc, create: CreateProc, delete: DeleteProc, mkDir: MkDirProc, rmDir: RmDirProc, link: LinkProc, symLink: LinkProc, rename: RenameProc, enumerate: EnumerateProc, getInfo: GetInfoProc, setInfo: SetInfoProc, read: ReadProc, write: WriteProc ]; CreateHandle: PROC [serverName: ROPE] RETURNS [h: Handle]; DestroyHandle: PROC [h: Handle]; Open: PROC [h: Handle, path: ROPE] RETURNS [fD: FileDescriptor] ~ INLINE { RETURN [h.procs.open[h.sH, path]] }; OpenProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE] RETURNS [fD: FileDescriptor]; Close: PROC [h: Handle, fD: FileDescriptor] ~ INLINE { h.procs.close[h.sH, fD] }; CloseProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor]; Create: PROC [h: Handle, path: ROPE, mode: Mode] RETURNS [fD: FileDescriptor] ~ INLINE { RETURN [h.procs.create[h.sH, path, mode]] }; CreateProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE, mode: Mode] RETURNS [fD: FileDescriptor]; Delete: PROC [h: Handle, path: ROPE] ~ INLINE { h.procs.delete[h.sH, path] }; DeleteProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE]; MkDir: PROC [h: Handle, path: ROPE, mode: Mode] ~ INLINE { h.procs.mkDir[h.sH, path, mode] }; MkDirProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE, mode: Mode]; RmDir: PROC [h: Handle, path: ROPE] ~ INLINE { h.procs.rmDir[h.sH, path] }; RmDirProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE]; Link: PROC [h: Handle, toPath, asPath: ROPE] ~ INLINE { h.procs.link[h.sH, toPath, asPath] }; LinkProc: TYPE ~ PROC [sH: ServerHandle, toPath, asPath: ROPE]; SymLink: PROC [h: Handle, toPath, asPath: ROPE] ~ INLINE { h.procs.symLink[h.sH, toPath, asPath] }; SymLinkProc: TYPE ~ PROC [sH: ServerHandle, toPath, asPath: ROPE]; Rename: PROC [h: Handle, fromPath, toPath: ROPE] ~ INLINE { h.procs.rename[h.sH, fromPath, toPath] }; RenameProc: TYPE ~ PROC [sH: ServerHandle, fromPath, toPath: ROPE]; EachNameProc: TYPE ~ PROC [name: ROPE] RETURNS [continue: BOOL _ TRUE]; Enumerate: PROC [h: Handle, dirPath: ROPE, pattern: ROPE, eachName: EachNameProc] ~ INLINE { h.procs.enumerate[h.sH, dirPath, pattern, eachName] }; EnumerateProc: TYPE ~ PROC [sH: ServerHandle, dirPath: ROPE, pattern: ROPE, eachName: EachNameProc]; GetInfo: PROC [h: Handle, fD: FileDescriptor] RETURNS [type: FType, size: CARD, mode: Mode, mTime: GMT] ~ INLINE { [type, size, mode, mTime] _ h.procs.getInfo[h.sH, fD] }; GetInfoProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor] RETURNS [type: FType, size: CARD, mode: Mode, mTime: GMT]; SetInfo: PROC [h: Handle, fD: FileDescriptor, mode: Mode, mTime: GMT] ~ INLINE { h.procs.setInfo[h.sH, fD, mode, mTime] }; SetInfoProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor, mode: Mode, mTime: GMT]; Read: PROC [h: Handle, fD: FileDescriptor, offset, count: CARD, bOffset: CARD, block: REF TEXT] RETURNS [bytesRead: CARD] ~ INLINE { bytesRead _ h.procs.read[h.sH, fD, offset, count, bOffset, block] }; ReadProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor, offset, count: CARD, bOffset: CARD, block: REF TEXT] RETURNS [bytesRead: CARD]; Write: PROC [h: Handle, fD: FileDescriptor, offset, count: CARD, bOffset: CARD, block: REF TEXT] RETURNS [bytesWritten: CARD] ~ INLINE { bytesWritten _ h.procs.write[h.sH, fD, offset, count, bOffset, block] }; WriteProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor, offset, count: CARD, bOffset: CARD, block: REF TEXT] RETURNS [bytesWritten: CARD]; OpenReadStream: PROC [h: Handle, path: ROPE] RETURNS [str: STREAM]; RetrieveFile: PROC [h: Handle, path: ROPE, into: STREAM]; OpenWriteStream: PROC [h: Handle, path: ROPE, mode: Mode] RETURNS [str: STREAM]; StoreFile: PROC [h: Handle, path: ROPE, mode: Mode, from: STREAM]; Error: ERROR [code: ATOM, msg: ROPE]; }... ΌUnixRemoteFile.mesa Copyright Σ 1985, 1986 by Xerox Corporation. All rights reserved. Last Edited by: Demers, November 8, 1987 10:22:24 am PST Types Parameters Handles A handle identifies a server. Create a handle to talk to the named server. Destroy a handle. Operations Open an existing file. Close the designated file. Create an empty file of the given name, smashing any existing one. The mode is the protection mode assigned to the new file. Delete the named file. Create a directory. Remove an empty directory. Create a hard link to file toPath under the name asPath. Since the link is hard, toPath must designate an existing file on the same file system volume as asPath. Create a Symbolic link to file toPath under the name asPath. No check to see whether the file exists. Rename atomically. The fromPath and toPath must be on the same file system volume. Enumerate files in directory designated by dirPath with names matching pattern. Lookup information on given file. Set (selected) information about given file. If mode is CARDINAL.LAST it will not be changed. If mTime is BasicTime.nullGMT it will not be changed. Read specified bytes of file into block. Return number of bytes read, update block.length. Write specified bytes of file from block. Return number of bytes written. Creature Comforts Open an input stream for reading from the named file. Retrieve the named file into the given stream. Open an output stream for writing to the named file. Store the named file from the given stream. Error File Server $viewNotImplemented -- server doesn't export Unix view $pathNameSyntax -- syntax error in pathname $perm -- caller is not owner $noent -- no such file or directory $io -- I/O error $nxio -- no such device or address $acces -- access permission denied $exist -- file already exists $nodev -- no such device $notdir -- argument not a directory and should be $isdir -- argument is a directory and shouldn't be $fbig -- file would grow too big $nospc -- no space left on device $rofs -- file system is readonly $nametoolong -- file name too long $notempty -- attempt to remove a nonemtpy directory $dquot -- disk quota exceeded $stale -- fhandle argument no longer valid RPC $wrongRPCVersion $wrongProgram $wrongProgramVersion $wrongProc Authentication $badCredentials $wrongCredentials $badVerifier $wrongVerifier $badReplyVerifier $wrongReplyVerifier $weakCredentials Network problems $timeout $unknownServer $unreachable Generic bad thing $protocol Κ6˜codešœ™Icode2šœB™B—™K™(—code1šΟk ˜ Mšœ œœ˜Mšœœœ˜Mšœ œ˜ Mšœœœ˜Mšœœ ˜—šΟnœœ ˜!Mšœ˜head™Kšœœœ˜KšœœΟc8œ˜UKšœœ œ˜KšœœœŸœ˜1Kšœœœ˜Kšœœ˜-Kšœœœœ˜—™ Kšœ œœ˜—™K™K˜Kšœœœ˜šœœœ˜K˜Kšœ˜K˜—K˜Kšœœœ˜2šœœœ˜&Kšœ˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜—šž œœœœ ˜:K™,—K˜šž œœ ˜ K™——™ š žœœœœœœ˜oK™K˜Kš œ œœœœ˜RK˜—šžœœ#œ˜QK™K˜Kšœ œœ(˜>—K˜š žœœœœœœ&˜…KšœHΟeœ1™}K˜Kš œ œœœœ˜`—K˜šžœœœœ ˜MK™K˜Kšœ œœœ˜7—K˜šžœœœœ%˜]K™K˜Kšœ œœœ˜B—K˜šžœœœœ˜KK™K˜Kšœ œœœ˜6—K˜šžœœœœ(˜]Kš œ œ œ œC œ™’K˜Kšœ œœ$œ˜?—K˜šžœœœœ+˜cKšœ œ œ/™fK˜Kšœ œœ$œ˜BK˜—šžœœœœ,˜eKšœ  œ œ(™SK˜Kšœ œœ&œ˜C—K˜Kš œœœœœ œœ˜Gš ž œœœ œœ9˜“Kšœ+ œ œ™OK˜Kš œœœœ œ˜d—K˜š žœœ!œœœœ˜rK˜8K™!K˜Kš œ œœ(œœœ˜z—K˜šžœœ4œœ,˜zKš œ1 œΠek ‘œ œ œ™•K˜Kšœ œœ;œ˜X—K˜šžœœ0œ œ œœœ œœG˜ΙKšœ" œ'  œ™[K˜Kšœ œœ7œ œ œœœ œ˜Œ—K˜šžœœ0œ œ œœœœœK˜ΡKšœ# œ"™JK˜Kšœ œœ7œ œ œœœœ˜——™š žœœœœœ˜CK™5K˜—šž œœœœ˜9K™.—K˜š žœœœœœ˜PK™4K˜—šž œœœœ˜BK™+——™šžœœœœ˜%™ K™6K™K™+K™KšœŸ™KšœŸ™#KšœŸ ™KšœŸ™"KšœŸ™"KšœŸ™KšœŸ™KšœŸ)™1KšœŸ+™2KšœŸ™ KšœŸ™!KšœŸ™ Kšœ Ÿ™"Kšœ Ÿ)™3KšœŸ™KšœŸ#™*—™K™K™ K™K™ —™K™K™K™ K™K™K™K™—™K™K™K™ —™K™ ———K˜M˜—J˜—…—,"