Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

File Formats

39 views
Skip to first unread message

Brian Parle

unread,
Nov 18, 2002, 11:55:50 AM11/18/02
to
I am looking at an internal legacy system I need to convert to newer
technology. Are .dat/.dia and .ix file extensions associated with BTree
database formats.

If so, how can I access the data contained in order to port data.

Regards,

Brian Parle,
Quantum Computing Limited
www.qcl.ie


Rob Roberts [TPX]

unread,
Nov 18, 2002, 2:29:01 PM11/18/02
to
Brian,

> I am looking at an internal legacy system I need to convert to
> newer technology. Are .dat/.dia and .ix file extensions associated
> with BTree database formats.
>
> If so, how can I access the data contained in order to port data.

As Stefan mentioned, those file extensions are used by B-Tree Filer. The
.dat file is the one that contains the actual data. You can treat it as a
regular Pascal file of records and process it sequentially. Ignore the
first record in the file, because it is a header record and does not contain
actual data. Your .dat file might also contain some deleted records. You
can run the B-Tree Filer bonus program CHECKFB to find out. There will be a
value displayed for NumFree, and this refers to the number of deleted
records. Assuming that the programmer who wrote the legacy system followed
the standard recommendation of reserving the first 4 bytes (i.e.- a Longint
field) of each record for use by B-Tree Filer, you can tell which records
are deleted ones by checking that field. If it is zero, the record is a
current, valid record. If it is non-zero, it is a deleted record.

It's easy enough to process the data file sequentially, but determining the
contents of each record is another matter. If you have the source code for
the legacy system, then it's no problem. Find the declarations of the
record layouts, and that will tell you how the fields are laid out in each
record. But if you don't have the source code, then you have some serious
detective work to do. Unlike SQL or DBASE tables, for example, B-Tree Filer
fileblocks do not contain any information about the structure of the file,
other than the record length, number of records, and number of deleted
records.

--Rob [TPX]


Stefan Andersson

unread,
Nov 18, 2002, 12:31:25 PM11/18/02
to
Hi!

Yes, it's BTree files. The .dat file contains the data and the .ix are the
index.

You need the record description in order to read the data. I belive it would
be possible to read the file serially but I should feel safer if it's done
with BTree...

HTH,
Stefan


Brian Parle

unread,
Nov 27, 2002, 9:33:30 AM11/27/02
to
Thanks to both Rob and Stefan.

I have since been able to make progress on the file structures,
unfrortunately without the benefit of the original file layout!!

A further query to tax your brains...
How are date and number values stored in the .dat file?
I can identify where these number and date fields are but I'd appreciate any
help you could give about their representation in the file.

Regards,

Brian Parle.

"Rob Roberts [TPX]" <do...@email.me> wrote in message
news:UOvTQjzj...@tpsmail01.turbopower.net...

Rob Roberts [TPX]

unread,
Nov 27, 2002, 10:06:52 AM11/27/02
to
Brian,

> A further query to tax your brains...
> How are date and number values stored in the .dat file?
> I can identify where these number and date fields are but I'd
> appreciate any help you could give about their representation
> in the file.

Number fields are just regular Pascal data types. In a BP app, they're
probably Bytes (1 byte), Integers (2 bytes), Longints (4 bytes), or Reals (6
byte, floating point). Dates can be stored in various ways. If the
original programmer was using B-Tree Filer, he may have also used TurboPower
DOS products Turbo Professional or Object Professional, in which case he may
have used the Date type from those libraries. The TPRO/OPRO Date type is a
longint and is compatible with the Systools TStDate. On the other hand, the
original programmer may have used strings, or some other method entirely.

--Rob [TPX]


0 new messages