DIRECTORY BasicTime USING [GMT], BTree USING [Tree], BTreeVM USING [Handle], File USING [FP, Handle, PropertyStorage, Volume], FSBackdoor USING [Version], IO USING [STREAM], Rope USING [ROPE, Text]; FSFileOps: CEDAR DEFINITIONS = BEGIN VolumeDesc: TYPE = REF VolumeDescObject; VolumeDescObject: TYPE = RECORD[ next: VolumeDesc, -- for linked list vName: Rope.ROPE, -- name of this volume prefix: Rope.ROPE, -- "[]" for use in lock table (NIL for system volume) vol: File.Volume, -- volume id tree: BTree.Tree, -- directory/cache BTree for the volume treeVM: BTreeVM.Handle -- storage object for the BTree ]; GetVolumeDesc: PROCEDURE [vName: Rope.ROPE _ NIL] RETURNS [VolumeDesc]; RecordUsage: PROCEDURE [fp: File.FP, time: BasicTime.GMT]; RegisterVolumeFlusher: PROCEDURE [svDesc: VolumeDesc]; CreateFile: PROCEDURE [vol: File.Volume, pages: INT] RETURNS [fp: File.FP, h: File.Handle]; OpenFile: PROCEDURE [vol: File.Volume, fp: File.FP] RETURNS [File.Handle]; LPCreatedTime: PROCEDURE [vol: File.Volume, fp: File.FP] RETURNS [BasicTime.GMT]; GetFileInfo: PROCEDURE [h: File.Handle] RETURNS [pages: INT, fp: File.FP]; SetFilePages: PROCEDURE [h: File.Handle, pages: INT]; DeleteFile: PROCEDURE [h: File.Handle]; GetProps: PROCEDURE [f: File.Handle] RETURNS [bytes: INT, keep: CARDINAL, created: BasicTime.GMT]; GetNameBodyAndVersion: PROCEDURE [f: File.Handle] RETURNS [nameBody: Rope.Text, version: FSBackdoor.Version]; InitializePropertyStorage: PROCEDURE [fp: File.FP, propStorage: File.PropertyStorage]; SetProps: PROCEDURE [f: File.Handle, bytes: INT, keep: CARDINAL, created: BasicTime.GMT, nameBody: Rope.Text, version: FSBackdoor.Version]; SetBytesAndCreated: PROCEDURE [f: File.Handle, bytes: INT, created: BasicTime.GMT]; SetKeep: PROCEDURE [f: File.Handle, keep: CARDINAL]; FileStreamMode: TYPE = {oldReadOnly, newAppendOnly}; CreateFileStream: PROCEDURE [file: File.Handle, mode: FileStreamMode] RETURNS [IO.STREAM]; Copy: PROCEDURE [from, to: File.Handle] RETURNS [bytes: INT, createdTime: BasicTime.GMT]; END. ÀFSFileOps.mesa Last Edited by: Schroeder, November 15, 1983 1:20 pm Volume Management - implemented in FSFileOpsImpl Returns a VolumeDesc for the named volume. NIL means the system volume for this Cedar instance. Will generate FS.Error[$unknownVolume] if the a named volume cannot be located, except that if the system volume is desired and no system volume is defined, then NIL is returned. Volume Space Management - implemented in FSFileSpaceImpl Informs the space management machinery that the global file identified by "fp" was used at the given "time", and therefore should be promoted in the lru list. "time" should be the same as the used-time in the corresponding BTree entry. Registers the volume flusher for the system volume with the File package. Is called internally by GetVolumeDesc the first time the system volume is gotten. File Access - implemented in FSFileOpsImpl Creates a new file of the indicated length. Maps any File.Error's generated into FS.Error's. Opens the indicated file. Maps any File.Error's generated into FS.Error's. Returns the created-time from the leader page of the indicated file. Maps any File.Error's generated into FS.Error's. Gets the page count of the indicated file. Maps any File.Error's generated into FS.Error's. Sets the page count of the indicated file. Maps any File.Error's generated into FS.Error's. Delete the indicated file. Maps any File.Error's generated into FS.Error's. Property Page Access - implemented in FSPropertiesImpl Returns properties associated with the file whose handle is presented. Can produce FS.Error[$invalidPropertyPage]. Maps any File.Error's generated into FS.Error's. Returns the nameBody and version number for the file whose handle is presented. Can produce FS.Error[$invalidPropertyPage]. Maps any File.Error's generated into FS.Error's. To be passed to File.Create as the "report" call back procedure. Sets the validation stamp in the property page to mark the file as belonging to FS. Sets the properties associated with the file whose handle is presented. "bytes" = -1 means don't change the byte count. "created" = BasicTime.nullGMT means don't change the created-time. Maps any File.Error's generated into FS.Error's. Sets the bytes count and created time in the leader page of the file whose handle is presented. The byte count is not altered if "bytes" = -1. The created-time is not altered if "created" is BasicTime.nullGMT. Can produce FS.Error[$invalidPropertyPage]. Maps any File.Error's generated into FS.Error's. Sets the keep in the leader page of the file whose handle is presented. Can produce FS.Error[$invalidPropertyPage]. Maps any File.Error's generated into FS.Error's. File Streams - implemented in FSFileStreamImpl Produces a stream on the indicated file. If the "mode" is "oldReadOnly" then endOf, getIndex, setIndex, getChar, and getBlock are implemented. If the "mode" is "newAppendOnly" then getIndex and putBlock (at the end of the stream only!) are implemented. The number of bytes indicated by the byte count property of the "from" file are transfered from that file to the "to" file. The byte transfered and the created-time property of the "from" file are returned. Maps any File.Error's generated into FS.Error's. ÊL– "Cedar" style˜Icode2šÏc™K™4code1šÏk ˜ Lšœ žœžœ˜Lšœžœ˜Lšœžœ ˜Lšœžœžœ#˜1Lšœ žœ ˜Lšžœžœžœ˜Lšœžœžœ˜—Lšœ žœž œž˜$™0Kšœ žœžœ˜(šœžœžœ˜ Kšœ˜$Kšœ žœ˜(Kšœ žœ<˜OKšœ ˜Kšœ'˜9Kšœ˜6Kšœ˜—š Ïn œž œ žœžœžœ˜GKšœ,žœAžœ’žœ ™”——™8šŸ œž œ žœžœ˜:K™ì—šŸœž œ˜6K™œ——™*š Ÿ œž œžœžœ žœ˜[K™]—šŸœž œžœžœ˜JK™K—š Ÿ œž œžœžœ žœ˜QKšœv™v—š Ÿ œž œžœ žœ žœ˜JKšœ\™\—šŸ œž œžœ˜5Kšœ\™\—šŸ œž œ˜'KšœL™L——™6š Ÿœž œžœ žœžœžœ˜bKšœ¥™¥—šŸœž œžœ4˜mKšœ®™®—šŸœž œ žœ%˜VKšœ’žœ™•—š Ÿœž œžœžœžœ4˜‹Kšœî™î—šŸœž œžœžœ˜SKšœ±™±—šŸœž œžœ˜4Kšœ¦™¦——™.Kšœžœ ˜4š Ÿœž œ+žœžœžœ˜ZKšœþ™þ—š Ÿœž œžœ žœžœ˜YKšœ€™€——Kšžœ˜—…—ðü