Help.

I am trying to use the file streaming functions to open a .pdb file that I
created using par.exe.
Here is the command line entry I used to create the .pdb file:

par c -a "stream" filname.pdb name type cid filename

For the name I just used a four letter acronym for the type of file it is
For the type I used "DATA"
I made the cid the same as the cid for my application

When I call FileOpen I get err = 0x1604 which I believe means
FileErrNotFound.
What am I doing wrong? The path and filename I pass to FileOpen are correct
and the .pdb file exists.
Any suggestions?
I am working with existing c code from my company in which the file I need
to open is of a company specific type so I created a .pdb file out of it and
then wrote my own function to handle the filename change as well as the mode
specifications that our code already handles.
I call FileOpen in a function where I have passed in a path and filename
pointing to the file I want to open and the mode to open it in.
Let me provide a snippet of my code below:

#define PALM_FILE_EXT  ".pdb"

 FILE *myfopen(const char *pName, const char *pFlags)
{
 UInt32   mode;
 Err    err = errNone;
 char   *pdbName;

 if (*pFlags == 'r')
 {
      mode = fileModeReadOnly;
 }
 else if (*pFlags == 'w')
 {
      mode = fileModeReadWrite;
 }
 else if (*pFlags == 'a')
 {
      mode = fileModeAppend;
 }
 //here I convert the name to filename_extension.pdb
 FNXA_STRCPY(pdbName, pName);
 AddUnderscore(pdbName);
 FNXA_STRCAT(pdbName, PALM_FILE_EXT );

 return (FILE *)FileOpen(0,pdbName,0,0,mode,&err);
}





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

Reply via email to