> after the 80 bytes header what you have is a record index, a list
> that is NumRecords length.

Yes, it is the elements of the record index that I am talking about.

> The first field, LocalID is the offset of the beginning of the 
> respective record.
> You need to calculate the record lenght (number of bytes to read)
> subtracting the next record start offset, or the file lenght for
> the last record.

I know that. As you might have not noticed, in my original message I quoted the 
PalmOS documentation which essentially says the above. My problem is that the 
contents of this field does not seem to match that description.

Please look at my example again. The first element of the record index looks 
like this:

02 D0 40 F3 20 01 00 00

The way I understand it, this means that:

localChunkID contains 02 D0 40 F3
attributes contains 20
uniqueID contains 01 00 00

As I said, the first data record resides at offset 0x02D0 from the beginning of 
the file - but definitely *not* at offset 0x02D040F3, as the contents of the 
localChunkID implies.

localChunkID is of type LocalID. That is 4 bytes, correct? Or is the PalmOS 
documentation wrong and the real format of the record index entry is something 
like this:

UInt16 localChunkID;
UInt16 unknown;  // What is this?
UInt8 attributes;
UInt8 uniqueID [3];

?

> The data in records is not structured, so each record could have
> different lenght and data types.
> Is up to your app how you interpret the read buffer.

Yes, yes, I understand that.

> I have done a program for creating/reading the PDB in VB, but it
> will only works for standard PDBs, and in OS5 an OS6 you have 2
> new databases types, extended and structured.

The PDB file I want to construct on the PC side is a standard PDB file - not 
one of the new types.

> At the end I found the best way to create a DB on a PC is doing a
> hotsync of the info from the PC to the PDB in the PDA and a later
> backup will give you the PDB you are looking for.

For various reasons this is not an acceptable solution for me. I need to 
construct the PDB file with the contents I want insde on the PC, without using 
the PDA. This ought to be possible - and would be, if I only understood the 
format of the localChunkID field.

> The oterh two fields in the record index are the record flags and
> an ID Palm uses internally, dont mind about this.

You mean, the attributes and the uniqueID? But don't the attributes have to 
reflect the real attributes of the records in the database and don't the 
uniqueIDs have to be requential numbers in order that reflects the logical 
order of the records?

> There is a PDF file called FileFormatSpec.pdf with the info you
> need, if you can not find it in Palm'Site, I can send it to you.

There is no file called like that on the PalmOS site. There is a file called 
"File Formats.pdf". If that is what you mean, it doesn't help - the two URLs I 
mentioned in my original message point to HTML information on the PalmOS site 
that contains exactly the same as the relevant portions of this PDF file.

Regards,
Vesselin
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to