Some parts of Pyrite make use of a data repository, in which local copies of data on the handheld can be kept for off-line use. For example, the Backup conduit keeps a complete backup of the handheld in the repository, in case the user needs to restore his data to a new device.
The repository is a directory tree which contains both general and application-specific sections. Its layout is designed to be generic enough to be useful to other Palm Computing platform-aware applications, in order to avoid duplication of data. The repository is also designed to work with multiple handhelds, distinguished by their user names.
Within the repository, there is a single subdirectory for each handheld user. By default, this directory is named the same as the device's user name. (Support for multiple handhelds with the same name may be available, but is currently untested and undocumented.)
Within each user's subdirectory are several other directories. The backup directory contains a complete backup of the handheld, each database stored as a standard prc/pdb file. The install directory holds databases (in prc/pdb format) which should be installed on the handheld at the next sync run. These directories should contain only databases; all other information must be stored elsewhere.
In addition to the backup and install directories, each desktop application may create its own directory for application-specific data. Pyrite currently doesn't use one yet, but if it ever does, it will be called Pyrite.
Example 3-1. Typical Repository Layout
/var/palm Location of repository ... /Rob Tillotson A user's data directory ... ... /backup Backup of that user's handheld ... ... /MemoDB.pdb ... ... /AddressDB.pdb ... ... ... ... ... /install Files waiting to be installed ... ... /Solitaire.prc ... ... /SolitaireDB.pdb ... ... ... ... ... /Pyrite/... Pyrite-specific data ... ... /XMDesktop/... Data from another desktop application ... /Bob Tillotson Another user's data directory ... ... /backup/... ... ... /install/... ... ... /Pyrite/...
On the handheld, nearly any character is valid in a database name, including even newlines and carriage returns. On the desktop, however, there are usually some characters which are illegal (or at least very inconvenient) to use in filenames. When Pyrite needs to construct a filename from a database name, it applies the following transformations:
Equal signs (=) are replaced by =3D
Slashes (/) are replaced by =2F
Newlines (ASCII 10) are replaced by =OA
Carriage returns (ASCII 13) are replaced by =0D
.prc is added if the database contains resources, .pdb is added otherwise.
Note: These rules are the same as those used by pilot-link.
Important: If you are running Pyrite on a non-Unix platform, the name transformation rules may be slightly different. As Pyrite is ported to non-Unix platforms, the differences will be documented here.