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: > Can anyone give me a pointer to where the structure of a relative file is > documented. I need to be able to read some without the benifit of RMS. > I'm not sure it's ever been "publically" documented. I have a copy of an "RMS-11 Design and Logic Manual" from 1977 which documents it, but it's 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. Anyway, according to this manual there are 3 possible record formats for a relative file: 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 ) +-----+--------+-----------------+------------------> ! ctl | size(2)| HDR(1-255) ! Data +-----+--------+-----------------+------------------> Records are stored in fixed length cells ( cell size as shown above ) Note this applies even to "variable length" records, the data the user sees is of a variable length but the space used within the file is constant for each record. Cells are stored in buckets ( number of blocks in a bucket is defined by the BUCKETSIZE attribute for the file ). Cells do not cross bucket boundaries. There is no "overhead" space in the bucket ( ie the first data cell starts at the first byte of the bucket ) 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 ). The first block of the file is the "prologue area". Data buckets begin at block 2. You will need one field from the prologue area, that is the "End of File Block", this is the last virtual block which has been initialized. You need this information so that you don't read past the logical end of file ( and into uninitialized blocks ). This value is a longword stored at an offset of 112 (decimal). I hope this information is helpful and accurate ( I've not worked with 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. -- ============================================================================= Malcolm Dunnett Malaspina College Email: dunnett@mala.bc.ca Computer Services Nanaimo, B.C. CANADA V9R 5S5 Tel: (604)755-8738