DIRECTORY IO USING [STREAM], Rope USING [ROPE]; YggHostFS: CEDAR DEFINITIONS = BEGIN RC: TYPE = { -- extension of "Reason" for internal use. ok, wentOffline, -- volume is not accessible (some drive has been offline) nonCedarVolume, -- the operation is not possible on a non-cedar (Pilot?) volume. inconsistent, -- the volume's (or file's) permanent data structures look inconsistent software, -- i.e. label-check. The page on disk is not the one the software expected. hardware, -- the disk hardware/microcode detected a hard disk error unknownFile, -- the file does not exist (possibly deleted since it was opened) unknownPage, -- the page would be beyond the end of the file volumeFull, -- the volume has no free pages (and one is needed!) fragmented, -- the file requires too many non-contiguous areas of disk mixedDevices, -- a bootable file is not entirely on one device, or not on correct device wrongVolume -- a bootable file is not on the correct volume }; Reason: TYPE = RC[SUCC[ok]..LAST[RC]]; -- error reason Error: ERROR [why: Reason, diskPage: INT _ -1]; VolumeID: TYPE[UNITS[CARD32]]; NullVolumeRep: PRIVATE TYPE = RECORD[a:CARD32]; nullVolumeID: VolumeID = LOOPHOLE[NullVolumeRep[a:0]]; PageNumber: TYPE = RECORD[INT]; PageCount: TYPE = INT; HostFile: TYPE = REF HostFileRep; HostFileRep: TYPE; Open: PROC [name: Rope.ROPE] RETURNS [HostFile]; Create: PROC [name: Rope.ROPE, size: PageCount ] RETURNS [HostFile]; Delete: PROC [file: HostFile]; Info: PROC [file: HostFile] RETURNS [size: PageCount, name: Rope.ROPE]; SetSize: PROC [file: HostFile, size: PageCount]; Read: UNSAFE PROC [file: HostFile, from: PageNumber, nPages: PageCount, to: LONG POINTER]; Write: PROC [file: HostFile, to: PageNumber, nPages: PageCount, from: LONG POINTER]; StreamFromOpenFile: PROC [openFile: HostFile] RETURNS [IO.STREAM]; END. ~YggHostFS.mesa Copyright Σ 1985, 1986, 1988 by Xerox Corporation. All rights reserved. Andrew Birrell, September 20, 1983 2:04 pm Russ Atkinson (RRA) February 27, 1985 9:18:16 pm PST Doug Wyatt, February 27, 1985 9:44:36 am PST Bob Hagmann May 13, 1988 9:36:46 am PDT Errors This error may be raised by most of the procedures. The possible values of "why" are detailed with each procedure. This error is raised after releasing internal locks: the facilities of this interface may be used from catch-phrases. Page may not make sense for some Errors, in which case it will be -1; it tries to give information about what page caused the error. For debugging, extra information may be available in the frame that raises this error. Types and Constants The permanent identification of a logical volume. Universally permanently unique. Guaranteed to be the UID of no volume. Actually, [0..LAST[INT]). The file-relative number of a data page. The first data page of a file is numbered 0. Actually [0..LAST[INT]]. Represents file sizes. The runtime representation of a file. NIL never represents a valid file. Files Creating a file stream ΚΪ˜codešœ™KšœH™HKšœ*™*K™4K™,Kšœ'™'—K˜šΟk ˜ Kšœœ ˜Kšœœœ˜—K˜KšΠbl œœ ˜Kšœ˜headšœ™šœœΟc*˜7Kšœ˜Kšœ Ÿ9˜FKšœŸ@˜PKšœŸG˜UKšœ ŸL˜VKšœ Ÿ9˜CKšœ ŸA˜NKšœ Ÿ/˜