Danny, Thanks for your response. Unfortunately that's not going to work for me, unless I've misinterpreted your answer. The files I'm talking about are big. Like 6 MB files. If I have to insert something in the middle, that means reading about 3 MB into memory -- memory I'm not likely to have (otherwise I wouldn't bother having the 6 MB file on a card). So I'd have to do it in 64K chunks (would have to anyway), which on the external media is going to take a while. I have a feeling there is a quicker way...someway that takes advantage of the structure of the VFS card.
FileZ takes 5+ minutes to move a 2 MB file from one directory to another, and I'm quite sure it's just doing a read/write in chunks. But if I start up MSImport and move it from one directory to another using the PC, it takes about a second. It can also transfer it to the computer and back to the card in under 15 seconds. If I could tap into that, I should be able to copy a portion of the file, add my new part, then copy the remainder just as fast. Or maybe there is some other trick. I can't have record inserts taking 5+ minutes on some of the smaller databases. I could do my own file structure and build a linked list, but then I lose the capability of moving it from the card to the palm. Jason --- On Wed 10/02, Danny Wong wrote: From: Danny Wong [mailto: [EMAIL PROTECTED]] To: [EMAIL PROTECTED] Date: Wed, 2 Oct 2002 14:10:19 -0400 Subject: RE: VFS Problem > 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 ------------------------------------------------ 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/
