DIRECTORY
BasicTime USING [GMT, nullGMT],
CommonSoftwareFileTypes USING [tCarryVolumeDirectory],
File USING [Type],
Floppy USING [FileHandle, PageCount, PageNumber, VolumeHandle],
NSString USING [String],
PrincOps USING [wordsPerPage];
Attributes: TYPE = REF AttributesRecord;
AttributesRecord:
TYPE =
MACHINE
DEPENDENT
RECORD[
-- used by directory or leader page.
identity attributes
seal: WORD ← sealValue, -- used to check consistency of a file.
version: CARDINAL, -- version of attributes record type.
type: --File.Type, -- CARD, -- file type of containing file.
activity attributes
createDate: Time, -- the creation data of the disk file.
lastWrittenDate: Time, -- the date the disk file was last modified prior to copying to the floppy.
file attributes
size: Floppy.PageCount ← 0, -- number of pages in the floppy file not including the leader page.
offset: Floppy.PageNumber ← 0, -- page number in the disk file correspoinding to the first page in the floppy file piece.
totalSize: Floppy.PageCount ← 0, -- number of pages in the disk file.
totalSizeInBytes: LengthInBytes ← 0, -- the number of bytes in the disk file
name attributes
length: CARDINAL ← 0,
maxLength: CARDINAL ← maxNameLength, -- so that @length is STRING.
name: PACKED ARRAY [0..maxNameLength) OF BYTE,
client attributes
clientDataLength: CARDINAL ← 0 ,-- number of component in client's private data.
clientData: SEQUENCE maxlength: CARDINAL OF UNSPECIFIED
LengthInBytes: TYPE = LONG CARDINAL;
Time: TYPE = BasicTime.GMT;
tFloppyLeaderPage: File.Type = CommonSoftwareFileTypes.tCarryVolumeDirectory;
currentVersion:
CARDINAL = 1;
-- update each time leader format changes
leaderLength:
CARDINAL = 1;
leaderLength*Environment.wordsPerPage must be greater than SIZE[AttributesRecord]
maxDataSize: CARDINAL = leaderLength*PrincOps.wordsPerPage - SIZE[AttributesRecord];
maxNameLength:
CARDINAL = 100;
includes words field.
nullTime: Time = BasicTime.nullGMT;
sealValue: WORD = 125252B; -- 1010101010101010 bits pattern
Open:
PROCEDURE
RETURNS[Floppy.VolumeHandle];
CreateFile:
PROCEDURE [attributes: Attributes]
RETURNS [Floppy.FileHandle];
Create a floppy file with the specified size and write information onto the leader page.
DeleteFile:
PROCEDURE [name: NSString.String];
LookUp:
PROCEDURE [name: NSString.String, attributes: Attributes]
RETURNS [Floppy.FileHandle];
name is used as search key; The attributes of the found floppy file will be filled.
Attribute Operations
GetAttributes: PROCEDURE [file: Floppy.FileHandle, attributes: Attributes];
SetAttributes: PROCEDURE [file: Floppy.FileHandle, attributes: Attributes];
Error: ERROR[type: ErrorType];
ErrorType: TYPE = {attributesNotAllowed, fileNotFound, invalidParameter, nameInUse, volumeNotOpen};
InconsistentFile: SIGNAL [file: Floppy.FileHandle];
InvalidVersion:
SIGNAL [file: Floppy.FileHandle, version:
CARDINAL];
NoRoomForClientData:
ERROR [wordsNeeded:
CARDINAL];
Raised by GetAttributes, cannot be RESUMEd.
END. -- AccessFloppy.
14-Jan-82 14:47:06 By Muntz: created file.
16-Aug-82 17:26:19 By CKabcenell: Converted to Filing 5.0.