cbruner wrote:
Thank you for a most informative post. You explained in 3 or 4
paragraphs what I've been looking in help files for a week.
So one last question (yeah right).
I'm trying to open "/COMPLIFE/GO.PRM" and it says that the volume isn't
mounted. So I'm now trying to mount the volume.
As I understand it, volumes are always mounted automatically when
possible. The one exception might be if an application is responding
to the notification that gets sent when a card is inserted into a
slot and then somehow preventing the filesystem from being mounted.
But you would definitely know if you were doing this.
My guess is the problem you're experiencing has to do with the volume
number. You have to discover the volume reference number of the volume
you want to use in order to be able to call VFSFileOpen(). In that
sense, a volume number is sort of like a drive letter in that it is
mapped for you by the operating system, the difference being that
unlike with, say, "C:", you can't assume that any certain volume
reference numbers exist.
The best thing in most cases is to look for the directory or file
you want to find by searching all volumes. This can be done with
VFSVolumeEnumerate(). The reference guide has an example loop
under the VFSVolumeEnumerate() documentation. You could write a
test loop and use VFSVolumeGetLabel() to see the volume label
associated with each volume (in a debug message or something) to
ensure you're trying the right one.
A common technique is to just try the desired path on all possible
volumes until you find that your file or directory actually exists.
Another technique for identifying a location is to store a volume
name AND a path, then convert the volume name into a volume reference
number and use that to open the file. To my knowledge, there is no
way to specify a volume name as part of a path. And, to convert
a volume name into a volume reference number, you have to enumerate
all the volumes and use VFSVolumeGetLabel() to see if it's the volume
you're looking for.
- Logan
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/