<> <> <> <> <<>> DIRECTORY AlpineEnvironment, AlpFile USING [Handle], AlpTransaction USING [Handle], Rope USING [ROPE]; AlpineDirectory: CEDAR DEFINITIONS = BEGIN <subDirectories>filename!version. (slashes are also acceptable.) The volGroupName is the name of the volume group. If the volume group doesn't exist on the server that this interface is bound to, an error is generated. There is one top level directory per Owner, the name of the directory is the same as the name of the owner. Subdirectories are just part of the string name and are not enforced by the directory package. When passing a name as a parameter, the client can use !H or !h to indicate the highest numbered version and !L or !l to indicate the lowest version. Unless otherwise specified, missing version numbers will default to !H. The maximum length for a name is 120 characters excuding the version number, 126 characters including it (same as FS). Names with * in them will generate an error. The file names returned are the canonical full path names as they are stored in the directory.>> <> <<(All directory references are made under the transaction using individual page locks and file intention locks on the owner's directory file according to normal Alpine conventions.) >> <<('subDirectories>filename' is also stored in the stringName property of the file. With this property and the Owner property, the scavenger will be able to reconstruct the directory. It is possible for clients to manually change the stringName of the file, but the file will still be added to the correct top-level directory, although the sub-directory information may be lost. Avoid this feature.)>> <<>> OPEN AE: AlpineEnvironment; CreateOptions: TYPE = {none, newOnly, oldOnly}; <<>> <> <<>> CreateFile: PROC [trans: AlpTransaction.Handle, name: Rope.ROPE, initialSize: AE.PageCount, recoveryOption: AE.RecoveryOption _ log, referencePattern: AE.ReferencePattern _ sequential ] RETURNS [openFileID: AlpFile.Handle, fullPathName: Rope.ROPE]; <> <> <> <<>> DeleteFile: PROC [trans: AlpTransaction.Handle, name: Rope.ROPE] RETURNS[fullPathName: Rope.ROPE]; <> <> <> <> OpenFile: PROC [trans: AlpTransaction.Handle, name: Rope.ROPE, updateCreateTime: BOOL _ TRUE, access: AE.AccessRights _ readOnly, lock: AE.LockOption _ [intendRead, wait], recoveryOption: AE.RecoveryOption _ log, referencePattern: AE.ReferencePattern _ sequential, createOptions: CreateOptions _ none] RETURNS [openFileID: AlpFile.Handle, createdFile: BOOL, fullPathName: Rope.ROPE]; <> <> <> <<>> Copy: PROC [trans: AlpTransaction.Handle, from, to: Rope.ROPE] RETURNS[fromName, toName: Rope.ROPE]; <> <. If 'to' already exists, then it will be overwritten. The directories for `from' and `to' must be on the same server, although they need not be in the same volume group. The client must have the correct create and delete permissions for the directory(s). 'fromName' and 'toName' are the canonical full path names as stored in the directory.>> <<>> Rename: PROC [trans: AlpTransaction.Handle, old, new: Rope.ROPE] RETURNS[oldName, newName: Rope.ROPE]; <> <> <<>> SetKeep: PROC [trans: AlpTransaction.Handle, fileName: Rope.ROPE, keep: CARDINAL] RETURNS[fullPathName: Rope.ROPE]; <> <> <<>> DisableKeep: PROC [trans: AlpTransaction.Handle, fileName: Rope.ROPE] RETURNS[fullPathName: Rope.ROPE]; <> <> <<>> SetDefaultKeep: PROC [trans: AlpTransaction.Handle, volume: Rope.ROPE, owner: AE.OwnerName, defaultKeep: CARDINAL]; <> <> <<>> <<>> <> <<>> Insert: PROC [trans: AlpTransaction.Handle, name: Rope.ROPE, file: AE.UniversalFile, keep: CARDINAL _ 0] RETURNS[oldFile: AE.UniversalFile, fullPathName: Rope.ROPE]; <> <> <> Remove: PROC [trans: AlpTransaction.Handle, fileName: Rope.ROPE] RETURNS[file: AE.UniversalFile, fullPathName: Rope.ROPE]; <> <> <<>> Lookup: PROC [trans: AlpTransaction.Handle, fileName: Rope.ROPE] RETURNS[file: AE.UniversalFile, fullPathName, link: Rope.ROPE]; <> <<'file' is the id for the file that would result from using OpenFile, independent of the number of links followed to get to it. 'name' is the actual name stored in the directory (may include an explicit version number). 'link' is the name of the first link towards the file, if there is one. If there is a link but the file has been deleted, then `file' will be null. >> Enumerate: PROC [trans: AlpTransaction.Handle, pattern, previousFile: Rope.ROPE, defaultVersion: Version _ all] RETURNS[file: AE.UniversalFile, fullPathName, link: Rope.ROPE]; <> <Laurel.cm is not. The default version used is given as a parameter because clients who enumerate in order to delete files use a different default than clients who enumerate to read or set properties.>> <, then only the names of the sub-directories will be returned. (Thus [volume]sub>*> will list all of the sub-directories of sub>, and [volume]*> will list all of the sub-directories on , including sub-directories of sub>).>> <> <<>> Version: TYPE = CARDINAL; lowest: Version = 0; highest: Version = LAST[CARDINAL]; all: Version = LAST[CARDINAL]-1; CreateLink: PROC [trans: AlpTransaction.Handle, name, referent: Rope.ROPE] RETURNS[fullPathName, referentName: Rope.ROPE]; <> <> <> CreateDirectory: PROC [trans: AlpTransaction.Handle, volume: Rope.ROPE, owner: AE.OwnerName]; <> <<>> <<>> <> <> <> <<>> AccessFailed: ERROR[missingAccess: AlpineEnvironment.NeededAccess]; LockFailed: ERROR[why: AlpineEnvironment.LockFailure]; OperationFailed: ERROR[why: AlpineEnvironment.OperationFailure]; StaticallyInvalid: ERROR; Unknown: ERROR[what: AlpineEnvironment.UnknownType]; PossiblyDamaged: SIGNAL; Error: ERROR[type: DirectoryErrors]; DirectoryErrors: TYPE = ErrorType[illegalFileName..circularLink]; ErrorType: TYPE = { illegalFileName, -- syntax error in file name. illegalPattern, -- syntax error in pattern name. entryNotFound, -- no fileID in directory or missing link entry. damagedDirectory, circularLink, -- creating this link would complete a circularity. <<-- values not in DirectoryErrors are used by AlpDirectory.>> authenticateFailed, -- caller not logged in properly. regServersUnavailable, -- (need Grapevine to authenticate) serverNotFound, serverBusy, ownerNotFound, -- owner not registered on the Alpine server. ownerRecordFull, fileNotFound, -- directory returned a fileID for a non-existant file. fileAlreadyExists, insufficientPermission, damaged, -- requested file. lockFailed, -- zapped by lock watchdog because of deadlock, etc. quota, remoteCallFailed, transAborted -- transaction created by this call went away }; <<>> END.