Jason,

Here is what I would do.

1. Find the location where you want to insert your new record and
save the pointer to it.
2. Use VFSFileResize() to resize the file
3. Use VFSFileRead() and VFSFileWrite() combo on the same opened for write
file to shift the file down.
4. Now write your new record in the location from the saved pointer in step
1.

Regards,
danny
www.toysoft.ca



 

-----Original Message-----
From: Jason Olsen [mailto:[EMAIL PROTECTED]] 
Sent: October 2, 2002 11:35 AM
To: Palm Developer Forum
Subject: VFS Problem



I have a database that is very large -- large enough it needs to be put on
an external card to be useful.  The Palm API allows easy read of this
database, but not easy writing to it when its on the card.  I can't move the
database back and forth from memory because there typically won't be enough
memory and it'll take too long.  

I've studied the PDB format and believe that I can add new records using the
VFSFileWrite and manually manipulating the pointers myself, but the file
structure requires inserting data into the middle of the file (pushing the
remaining data down).  Again, I run into the size issue -- I can't read and
rewrite it all at once and I suspect it will take minutes just to insert one
new record.

Surely somebody else has run into something like this.  Ideas?

Jason



------------------------------------------------
Changed your e-mail?  Keep your contacts!  Use this free e-mail change of
address service from Return Path.  Register now!

-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to