"David Chevalier" <[EMAIL PROTECTED]> wrote in message
news:54872@palm-dev-forum...
> This is regarding corrupted pdb's and prc's when translating them from PC
> file stream to a palm via ExgDBRead.
> I noticed that my pdb's records were getting corrupted, if and only if:
> 1) a record was greater than 1024 bytes
> and
> 2) my PrvReadProc routine returned less than the requested sizeP number of
> bytes for that record
David & I have been investigating this bug. For the record, we've found that
ExgDBRead doesn't always handle the ReadProc returning less than it was
asked for. It can produce corrupt databases on Palm OS 3.0 through 3.5. On
Palm OS 4.0, it'll return dmErrCorruptDatabase instead. We're still trying
to figure out the exact conditions under which this happens. David's
workaround is a good one:
> My fix for this was to busy-wait inside PrvReadProc until I had
accumulated the
> number of bytes requested in sizeP by ExgDBRead (unless of course sizeP
was
> greater than the number of remaining bytes available in my data stream, or
there's
> no more data to read)
--
Danny @ Palm
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/