Hi All,

I'm new to PalmOS programming, and I'd appreciate some advice about what direction I should go, before I head too far down what might be the wrong path. I'm trying to write an application that will look up some info from a large data file, about 2 to 3 MB. I have a DOS version that I've been using on the old HP palmtop, and I'd like to port it to Palm. The DOS version is a text file, with each record equal to one line, and another file that is an index into that file, to make searches fast. The search program is very small and fast, looking up the request in the index, then seeking that location in the text file, outputting the resultant data to stdout.

How is the best way to handle this data in PalmOS? I gather that 2 MB is too large for Palm applications, which have a 64 KB limit.

So I guess the File Streaming tools are the ones I should use? I've written a small code fragment to attempt to create a text file on the Palm:

Err *errp;
FileHand myStream = FileOpen(0,"a.txt",0,0,fileModeReadWrite,errp);
if (errp) { Message("file error"); }  // Message() is elsewhere
FileClose(myStream);

This compiles fine, but when I try to run it on the POSE, I get a message box that says "App just wrote to memory location 0x000D5912, which is in the storage heap. In order to protect the integrity of the user's data, such direct access is not allowed. Instead, applications should use speacial Palm OS functions for this purpose."

So how do I write a file with streaming? Is it just the emulator that doesn't allow this, while it would actually work on a Palm itself?

Is there any other advice?

thanks,

Curtis Cameron

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

Reply via email to