I just iterate over all volumes until I find the one, with the data I'm
looking for. Then I remember this one until my app quits. This o.c. only
works if you want to read something. If you have to write, you better
present the user all volume names found in the system. Someone could
prefer to save to the internal card, or to the left card on Zodiac or
the right one or whatever.

Henk. Thanks. I will definately implement your suggestion.

This doesn't address my current problem, though, as far as I can tell. The code I posted before:

   Err cfVolNum(
        UInt16& volNum,    // returned
        UInt8 cardIndex)      // 0 for first card, 1 for second, etc.
   {
        Err err;
        UInt32 volIterator = vfsIteratorStart;
        while (volIterator != vfsIteratorStop) {
             err = VFSVolumeEnumerate(&volNum, &volIterator);
             if (err == errNone) {
                  // found a volume -- return if it's the one we want
                  if (cardIndex == 0)
                       return errNone;
                  else
                       cardIndex--;
             }
        }
        return expErrCardNotPresent;
   }

Should have returned the second volume found on the device for when cardIndex = 1, regardless of whether it was in internal memory or on the T5's removable card, shouldn't it? It works properly on the T5's simulator, but not on the actual device.


Rich


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

Reply via email to