"Lawrence Lau" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Palm developers,
>
> I am trying to develop an application for logging some data (GPS data) to
a
> text file (not PDB) in SD card.

Look in the OS API reference under "Virtual File System Manager".

Here's some code to wet your appetite:
----------------
Char* filename = "/helloworld.txt";
Char* text = "Hello world";
// Normally you enumerate through the available volumes using
VFSVolumeEnumerate.
// We assume the volume ref is 1 here.
UInt16 volRefNum = 1;
// Create file
VFSFileCreate(volRefNum, filename);
// Open file
FileRef fileRef;
VFSFileOpen(volRefNum, filename, vfsModeWrite, &fileRef);
UInt32 numBytes = StrLen(text);
UInt32 written;
// Normally you'd call VFSFileWrite in a loop.
VFSFileWrite(fileRef, numBytes, text, &written);
// Close file
VFSFileClose(fileRef);
----------------

Working with VFS in a real application is a bit more involved, of course.


Regards
-Laurens



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

Reply via email to