DIRECTORY BasicTime USING [GMT], BTree USING [Tree], BTreeVM USING [Handle], File USING [FP, Handle, PageCount, 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]; OldestLruDate: PROC RETURNS [date: BasicTime.GMT]; CreateFile: PROCEDURE [vol: File.Volume, pages: INT, VMBackingFile: BOOL _ FALSE] 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, nPages: File.PageCount]; 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 Copyright c 1985 by Xerox Corporation. All rights reserved. Last Edited by: Schroeder, November 29, 1983 3:04 pm Bob Hagmann, May 3, 1985 8:28:01 am PDT 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. It's ok to register a new volume flusher on top of an old one. If the argument is NIL then any existing volume flusher is deregistered and turned off. Returns reference date of oldest file in the cache. If the LRU list has not been constructed, return BasicTime.earliestGMT. 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. Bob Hagmann February 4, 1985 9:42:39 am PST Cedar 6.0 interface changes, Copyright Bob Hagmann May 3, 1985 8:28:01 am PDT changes to: RegisterVolumeFlusher ʯ– "Cedar" style˜code2šÏc™Kšœ Ïmœ1™<—™Icode0™$L™'—code1šÏk ˜ Mšœ ŸœŸœ˜MšœŸœ˜MšœŸœ ˜MšœŸœŸœ.˜