Contents Previous Next

The Superbase data file (.SBF)

Superbase data files consist of a number of blocks of data. The first block in the file contains header information, and subsequent blocks contain records of data. Each record uses a minimum of one block, but long records can extend across multiple blocks. No blocks contain more than one record. All blocks in the file are of the same size. The number5 of bytes in a block is always a power of 2 (the size is indicated in the header). The maximum block size is 64 bytes.

When Superbase deletes a record from a file, the data is not physically removed. The blocks which the deleted records used are flagged as deleted and added to a chain of deleted blocks. These blocks can then be re-used when a record is added or increased in size.

The following table describes the format of the .SBF header block.

Bytes: Name: Notes:
0-3 DChain Pointer to the first block in Deleted blocks list (file offset/block size). Bits 6 and 7 in bytes 3 should be ignored
4-7 DCount Number of deleted blocks in the chain
8-11 SerialNo Serial number for the file
12-15 NumRecs Number of records in the file
16-19 NumberBlocks Number of blocks in the file (file length/block size)
20-21 BlockSize Number of bytes per block
22 NumUsers (Pre version 1.3 LAN only) Number of users of this file
23 NumWrite (Pre version 1.3 LAN only) Number of users with Write access
24-56 Reserved Reserved area. When writing a file, all bytes should be set to the internal version number(0x05)
57-58 Version Superbase Version 1.o files are 0x00
Version 1.3 file are 0x02
Version 2.0 files are 0x05
59 AVersion Padding. Set to 0x05
60-BlockSize Padding These bytes should be set to null (0x00)

All other blocks in the files are data blocks, which have the following format:

Byte: Name: Notes:
0-3 Next Pointer Pointer to the next block in this record (the file offset divided by the block size). Byte 3 also contains the following bit flags:

Bit 7, FirstBlock. If this is set, this block is the first data block for the record. Subsequent data blocks are linked to this block by NextPointer, but will not have this bit set. The last block in the record has NextPointer set to 0

Bit 6, Deleted. This bit is set if the data block belongs to a record that has been deleted. The data in this block is thus considered invalid. NextPointer will point to the next block in the deleted blocks chain, which starts from the data file header block

4-BlockSize Data The remainder of the block contains data

More:

Storage of data types

Text fields

Numeric fields

Date and time fields

Non-stored fields

The effect of REORGANIZE on a Superbase file


Contents Previous Next