If the file being downloaded is a pdb or prc file, the program must treat the incoming bytes in a way. If the file is of any other kind, it is considered a text file, and the program handles them in another way.
The problem is how to identify, based on the bytes being dowloaded, if the file is a database or not.
This is a tough problem, as the Palm OS Database format doesn't have any distinguishing header fields that say "this is a PRC or PDB file". One of our engineers ran a "PRC Scanner" on his own development system, and almost half of the files were "valid" PRCs.
Since you're getting items through FTP, you have access to the filename used on the remote system. That's a start. After that, the only other checks that might help would be validity of characters in the database name (must be ASCII 32-127), validity of offsets to info and sort blocks, and validity of offsets to DB records.
-- Ben Combee, DTS technical lead, PalmSource, Inc. Read "Combee on Palm OS" at http://palmos.combee.net/
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
