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.

slotParam.vfsMountParam.mountClass =     vfsMountClass_SlotDriver;
err = ExpSlotEnumerate(&slotParam.slotRefNum,    &slotIterator);

DisplayMessage("1 Error is ",GetErrorStr(err));   // no error
err = ExpSlotLibFind(slotParam.slotRefNum,    &slotParam.slotLibRefNum);
 DisplayMessage("2 Error is ",GetErrorStr(err)); // no error

the following give errors that the card is already mounted under a different file system

err = VFSVolumeMount(vfsMountFlagsUseThisFileSystem,vfsFilesystemType_FAT,
  (VFSAnyMountParamPtr) & slotParam);
DisplayMessage("3 Error is",GetErrorStr(err));
err = VFSVolumeMount(vfsMountFlagsUseThisFileSystem,vfsFilesystemType_VFAT,
  (VFSAnyMountParamPtr) & slotParam);
DisplayMessage("3 Error is",GetErrorStr(err));

using this causes a program crash
err = VFSVolumeMount(NULL,NULL   (VFSAnyMountParamPtr) & slotParam);
DisplayMessage("3 Error is",GetErrorStr(err));    // doesn't get here



Chris Bruner
Compulife Software Inc.
==============================================
----- Original Message ----- From: "Logan Shaw" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Monday, September 26, 2005 2:55 PM
Subject: Re: File Save dialog for VFS?


cbruner wrote:
I wasn't actually using vfs. I was using FileOpen

Palm OS is confusing that way.  There are two different types of files.
File Streams are what FileOpen() and friends work on.  File Streams
are files encapsulated inside a Palm database, so they exist in RAM
(or other storage heap implementation).  Meanwhile, VFS filesystems
are what you see on an SD Card.  They are just like a traditional
filesystem, with directories, pathnames, and all that.  99% of the
time, you want to use VFS files instead of File Streams.  The reason
it's named so confusingly is that File Streams predate VFS, so they
got the more logical name.

Err err;
FileHand fh;
fh = FileOpen(0,"go.prm",0,0,fileModeReadOnly,&err);
if (fh!=0) DisplayMessage("Opened go.prm!!!");
else
{
 fh = FileOpen(0,"\go.prm",0,0,fileModeReadOnly,&err);

That backslash there is wrong for two reasons.  No wait, three
reasons:

(1)  File Stream files don't have directories, so there is no
     path needed.
(2)  Even if it were a VFS file, you use a forward slash instead
     of a blackslash.  As far as I know, no pathname anywhere
     on the Palm uses a backslash.
(3)  If you needed a backslash, you'd need to escape that
     one with a double backslash.

the file "GO.PRM" is located in the root directory. (should it be somewhere else?).
I'll play with VFS routines and see if that works better.

If it's in the root directory, then its pathname will be "/GO.PRM".

In the meantime, on Windows the program is set up as
C:\Complife\all the files.

What would be the best way to set it up on the palm?

On each filesystem, there is a directory that contains Palm
applications and databases.  The directory varies, but it's
usually /PALM/Launcher.  On some newer devices, it's /Applications.
There's a way to get the appropriate pathname for a given filesystem.
I forget, but I think VFSGetDefaultDirectory() and passing ".prc"
as the 2nd argument might be the right thing to do.

Anyway, lots of people, especially if their app needs multiple
files, will create a subdir under that to keep them separate
from everything else.  So, you might choose /PALM/Launcher/Complife
or /Applications/Complife or similar to put them all in.  It also
wouldn't be a terrible thing just to put them at /Complife.  There
are no hard and fast rules.

  - Logan

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




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

Reply via email to