For faster navigation, this Iframe is preloading the Wikiwand page for PDB (Palm OS).

PDB (Palm OS)

PDB is a container format for record databases in Palm OS, Garnet OS and Access Linux Platform. Its structure is similar to PRC resource databases.[1] The PalmDOC eBook format is a special version of the PDB format.[2]

Structure of PDB file

A PDB file contains a PDB header, PDB record headers and records.[3][4]

PDB Header
PDB Record Header
PDB Records

PDB Header

The PDB header is located at the beginning of the file and contains meta-information on the file:[3]

Offset Name Type Size
0x00 name char (Modified ISO-8859-1) 32 Bytes
0x20 file attributes integer 2 Bytes
0x22 version integer 2 Bytes
0x24 creation time 32bit integer - PDB Datetime 4 Bytes
0x28 modification time 32bit integer - PDB Datetime 4 Bytes
0x2c backup time 32bit integer - PDB Datetime 4 Bytes
0x30 modification number integer 4 Bytes
0x34 app_info integer 4 Bytes
0x38 sort_info integer 4 Bytes
0x3c type integer 4 Bytes
0x40 creator integer 4 Bytes
0x44 unique_id_seed integer 4 Bytes
0x48 next_record_list integer 4 Bytes
0x4c num_records integer 2 Bytes

PDB Record Header

For every record, there is an eight byte record header, containing:[3]

name type size notes
offset integer 4 bytes Byte number in the PDB file (counting from zero), where the record is located
attributes byte 1 byte Attributes of the record (delete/dirty/busy/secret/category)
UniqueID integer 3 bytes Always 0

PDB Records

Now the records themselves follow. The usual order is AppInfoArea, SortInfoArea and records, sequentially.[4]

PDB Datetimes

Many PDB format files used times counting in seconds from 1904-01-01T00:00:00. This is the base time used by the original Macintosh (up to Mac OS 9). It may be noted that there were close links between Palm OS and Mac OS during early development. Using an unsigned 32-bit integer and the 1904 epoch, integer overflow will overflow will occur sometime in 2040.

Others may be observed to be counting from 1970-01-01T00:00:00 (the Unix epoch base time), and uses a signed 32-bit integer which will overflow sometime in 2038.

Palm OS Protein C/C++ Compiler Language & Library Reference, Copyright 2004 Palm Source calls the dates calculated from 1904 "old Palm epoch", and the dates calculated from 1970 "UNIX epoch". Protein C also provides functions (palm_seconds_to_time_t(), and time_t_to_palm_seconds() ) for converting between the two.

Some sources even suggest some very old files may use times counting from 1900 (which would be consistent with the Excel epoch).

This conflict between old Palm (Mac OS 9) epoch and UNIX epoch is unfortunate, the following heuristic may be useful when examining a file copied from a Palm OS device:

  • If the time has the top bit set, it's an unsigned 32-bit number counting from 1st Jan 1904
  • If the time has the top bit clear, it's a signed 32-bit number counting from 1st Jan 1970.

This is based on the idea that, otherwise the time would be before 1972 or before 1970 (depending on the interpretation) and the PDB format wasn't around then.

The palmdump utility and other software uses this rule-of-thumb when reading files.

See also

References

  1. ^ N. Rhodes, J. McKeehan. Palm OS Programming, Second Edition, O'Reilly, 2001, ISBN 1-56592-856-3
  2. ^ MobileRead Wiki: Specification of the PalmDOC format
  3. ^ a b c Paul J. Lucas (1998) PDB (Pilot Database) file format. Archived 2022-02-23 at the Wayback Machine Accessed on 20090308
  4. ^ a b Microfirst Software. The Pilot Record Database Format Archived 2009-03-15 at the Wayback Machine Accessed on 20090308
{{bottomLinkPreText}} {{bottomLinkText}}
PDB (Palm OS)
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?