>I am developing an app that needs to support read-only access of a pdb >database on a vfs expansion card. However, it is not practical to load an >entire record into memory using VFSFileDbGetRecord().
Perhaps there's something unusual about your situation, but in most cases it is in fact very practical to read the entire record into memory. Reading and writing from external storage is much, much slower than doing the same for internal memory, and any device that has VFS (currently) also has at least 128k of dynamic heap, and usually 256k heap. (Actually I don't recall if any have 128k heaps or not.) So if you'll eventually read the whole record in, or if you're going to read more than just one subset of the record, it'd probably be worthwhile to get it all at one time. Do your own timing tests, though. >I have read all the documentation, and it seems that in that case, I need >to parse the pdb format myself. Is this true? If you're not using those utility functions, yes. But there's sample code at http://oasis.palm.com/dev/kb/samples/2729.cfm that should be nearly all of what you need - it isn't hard to do. If efficiency is a concern then it is probably worth your while to use the above samples to cache the offsets of the records or resources, so you can do direct reads when the time comes to load in the data. VFSFileDbGetRecord et al don't cache any data, so they have to do multiple reads each time to find where the resources or records are, and that'll impact performance as well. >Secondly, is there any way I can seek directly to a record of a given >index in a file db, or do I have to walk through every record until I get >to it? See the PDB file format documentation - it is nearly the same between record and resource databases and the above sample could easily be modified to meet your needs for record DBs. -David Fedor PalmSource, Inc. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
