Skip to content
Surf Wiki
Save to docs
general/computer-file-formats

From Surf Wiki (app.surf) — the open knowledge base

PDB (Palm OS)

Container format


Container format

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. The PalmDOC eBook format is a special version of the PDB format.

Structure of PDB file

A PDB file contains a PDB header, PDB record headers and records.

PDB Records

PDB Header

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

OffsetNameTypeSize
0x00namechar (Modified ISO-8859-1)32 Bytes
0x20file attributesinteger2 Bytes
0x22versioninteger2 Bytes
0x24creation time32bit integer - PDB Datetime4 Bytes
0x28modification time32bit integer - PDB Datetime4 Bytes
0x2cbackup time32bit integer - PDB Datetime4 Bytes
0x30modification numberinteger4 Bytes
0x34app_infointeger4 Bytes
0x38sort_infointeger4 Bytes
0x3ctypeinteger4 Bytes
0x40creatorinteger4 Bytes
0x44unique_id_seedinteger4 Bytes
0x48next_record_listinteger4 Bytes
0x4cnum_recordsinteger2 Bytes

PDB Record Header

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

nametypesizenotes
offsetinteger4 bytesByte number in the PDB file (counting from zero), where the record is located
attributesbyte1 byteAttributes of the record (delete/dirty/busy/secret/category)
UniqueIDinteger3 bytesAlways 0

PDB Records

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

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.

References

References

  1. N. Rhodes, J. McKeehan. Palm OS Programming, Second Edition, O'Reilly, 2001, {{ISBN. 1-56592-856-3
  2. MobileRead Wiki: [http://wiki.mobileread.com/wiki/PalmDOC Specification of the PalmDOC format]
  3. Paul J. Lucas (1998) [http://www.hotpaw.com/rhn/palm/pdb.txt PDB (Pilot Database) file format.] {{Webarchive. link. (February 23, 2022 Accessed on 20090308)
  4. Microfirst Software. [http://membres.lycos.fr/microfirst/palm/pdb.html The Pilot Record Database Format] {{webarchive. link. (2009-03-15 Accessed on 20090308)
Info: Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about PDB (Palm OS) — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report