I'm wondering if I can use VFSFileGet(Set)Attributes to set my own custom flag for a file. The attributes is a 32-bit number, but the OS only seems to be using the lowest 8-bits or so and the rest are undefined (according to the "File and Directory Attributes" list). It seems like a dangerous thing to do, esp. since future OS versions may be using them, but if someone knows otherwise, it would make a section of code I'm writing *much* simpler.
Hi Rich. Why not just make a second prefs file? e.g., "/PALM/Programs/MyApp/prefs.dat", and you can VFSRead/VFSWrite to your heart's content. This is by far the best way to do this.
If that doesn't work, it's a little more hackish.
If the file is a PDB that you've exported to the card, then it abides by the PDB format specification posted here:
http://www.palmos.com/dev/support/docs/fileformats/Intro.html#939717
The Right Way to do this is to use an AppInfo block. For example, before you export the PDB, you could create and attach to the DB an AppInfo block that contains a single DWord that is your own attribute bitfield. Once exported to VFS, you could read this DWord by calling into VFSFileDBInfo() and working with the appInfoHP it returns. To write it, though, you would have to manually compute its offset (use the PDB format spec above) in the VFS file, and then use VFSFileSeek() and VFSFileWrite().
A lot of work for one little flag, I know. prefs.dat is the easiest way.
-Jeff Ishaq
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
