System Overview and Internals
Chapter Updated 11/01/25
| Extension | Description | Supported by Xbase64 library? |
|---|---|---|
| *.DBF | Main DBF file or table name | |
| *.DBT | Verson 3 or Version 4 memo file | |
| *.NDX | Single tag index file | |
| *.MDX | Multi tag index file | |
| *.INF | ODBC file used for auto open of NDX files | |
| *.NTX | Clipper indexfile | |
| *.CDX | Fox Pro indexfile | |
| *.IDX | Fox Pro index file |
| Position | Length | Description |
|---|---|---|
| 0 | 1 byte | file version number (03H without a .DBT file) (83H with a .DBT file) |
| 1-3 | 3 bytes | date of last update (YY MM DD) in binary format |
| 4-7 | 32 bit number | number of records in data file |
| 8-9 | 16 bit number | length of header structure |
| 10-11 | 16 bit number | length of the record |
| 12-13 | 20 bytes | |
| 14 | 1 byte | Transaction flag |
| 15 | 1 byte | Encryption flag |
| 16-27 | 20 bytes | |
| 28 | 1 byte | Index flag |
| 29 | 1 byte | Language Driver ID |
| 30-31 | 2 bytes | |
| 32-n | 32 bytes each | field descriptor record (see below) |
| n+1 | 1 byte | 0DH as the field terminator |
| Position | Length | Description |
|---|---|---|
| 0-10 | 11 bytes | field name in ASCII zero-filled |
| 11 | 1 byte | field type in ASCII (C N L D or M) |
| 12-15 | 32 bit number | field data address |
| 16 | 1 byte | field length in binary |
| 17 | 1 byte | field decimal count in binary |
| 18-31 | 14 bytes | reserved bytes (version 1.00) |
| DATA TYPE | DATA RECORD STORAGE |
|---|---|
| Character | ASCII characters, left justified, right blank filled |
| Date | (8 digits in YYYYMMDD format, such as 19601007 for October 7, 1960) |
| Logical | ? Y y N n T t F f (? when not initialized) |
| Memo | 10 digits representing a .DBT block number |
| Numeric | . 0 1 2 3 4 5 6 7 8 9 + -, right justified, left blank filled |
| Float (Version IV only) | . 0 1 2 3 4 5 6 7 8 9 + -, right justified, left blank filled |
| Memo Block Types |
|---|
| Head Block |
| Only data block for memo field |
| First of several contiguous data block set |
| 2-n of contiguous data block set |
| Only data block in free chain (version IV only) |
| First of several contiguous free block set (version IV only) |
| 2-n of contiguous free block set (type IV only) |
| Start Pos | End Pos | Len | Type | Description |
|---|---|---|---|---|
| 1 | 4 | 4 | int | Next Block ID |
| 5 | 8 | 4 | int | Not used all 0x00's |
| 9 | 16 | 8 | char | Version IV only. Filename, left justified, right 0x00 filled. Files names longer than 8 bytes are trunctated at 8 bytes. |
| 17 | 17 | 1 | char | 0x03 for Version III 0x00 for Version IV |
| 18 | 18 | 1 | char | 0x00 |
| 19 | 20 | 2 | char | Version 3 is 0x00, 0x00 Version 4 is 0x02, 0x01. Not sure what this represents. |
| 21 | 22 | 2 | int | Version IV only. Block Size |
| 23 | Blocksize | Blocksize - 22 | filler |
| Start Pos | End Pos | Len | Type | Description |
|---|---|---|---|---|
| 0 | 1 | 2 | short int | 0xff, 0xff (-1) |
| 2 | 3 | 2 | short int | Starting position of data (always 8?) |
| 4 | 7 | 4 | int | Length of data includes first 8 bytes |
| 8 | Calc | Calc | char | Data |
| Start Pos | End Pos | Len | Type | Description |
|---|---|---|---|---|
| 0 | 3 | 4 | int | Next free block in the free block chain |
| 4 | 7 | 4 | int | Number of free blocks in this contiguous free block set |
| Error Code | Description |
|---|---|
| EBADF | Invalid file descriptor |
| EINVAL | Invalid lock information or file does not support locks |
| EACCESS EAGAIN | Lock can not be set because it is blocked by an existing lock on the file. |
| ENOLCK | The system is out of lock resources, too many file locks in place. |
| EDEADLK | Deadlock condition |
| EINTR | Process was interrupted by a signal while it was waiting |
