B From:	MERC::"uunet!WKUVX1.BITNET!MacroMan" 17-APR-1993 14:42:59.74 To:	MACRO32@WKUVX1.BITNET  CC:	% Subj:	Re: Structure of relative files   + In article <1993Apr16.180924.4401@cpu.com>, /     gwlester@cpu.com (Gerald W. Lester) writes:   K > Can anyone give me a pointer to where the structure of a relative file is I > documented.  I need to be able to read some without the benifit of RMS.  >   H    I'm not sure it's ever been "publically" documented. I have a copy ofJ an "RMS-11 Design and Logic Manual" from 1977 which documents it, but it'sH not a regular DEC publication, it's something that looks like it was run? off on a line printer, with figures hand drawn (and typed ) in.   G    Anyway, according to this manual there are 3 possible record formats  for a relative file:  G      MRS = Maximum record size ( as stored in files record attributes ) ?      FIXED CTL = Size of Fixed Control Area ( for VFC records )   )    Fixed length record ( cell = MRS + 1 )   ;        +-----+-------------------------------------------->         | ctl |     Data ;        +-----+-------------------------------------------->   -    Variable Length record  ( cell = MRS + 3 )   ;        +-----+--------+----------------------------------->         | ctl | size(2)|   Data;        +-----+--------+----------------------------------->   ;    Variable Length with VFC  ( cell = MRS + FIXED CTL + 3 )   <        +-----+--------+-----------------+------------------>0        ! ctl | size(2)| HDR(1-255)      !   Data<        +-----+--------+-----------------+------------------>  H    Records are stored in fixed length cells ( cell size as shown above )I    Note this applies even to "variable length" records, the data the user N    sees is of a variable length but the space used within the file is constant    for each record.   H    Cells are stored in buckets ( number of blocks in a bucket is definedH    by the BUCKETSIZE attribute for the file ). Cells do not cross bucketH    boundaries. There is no "overhead" space in the bucket ( ie the first5    data cell starts at the first byte of the bucket )   E    In each case ctl is a single byte which indicates if the record in ?    this position currently exists ( value 8 ), has been deleted )    ( value 4 ) or never used ( value 0 ).   I    The first block of the file is the "prologue area". Data buckets begin F    at block 2. You will need one field from the prologue area, that isI    the "End of File Block", this is the last virtual block which has been I    initialized. You need this information so that you don't read past the G    logical end of file ( and into uninitialized blocks ). This value is 3    a longword stored at an offset of 112 (decimal).   I    I hope this information is helpful and accurate ( I've not worked with I    relative files much so I'm just quoting from the manual ). Let me know <    if you need any more information and I'll try to find it.   --M ============================================================================= M Malcolm Dunnett    Malaspina College                Email: dunnett@mala.bc.ca H Computer Services  Nanaimo, B.C. CANADA V9R 5S5       Tel: (604)755-8738