Thanks for the comments on my code! I changed the file stream open mode to
fileModeReadOnly. I still get a valid (not-null) file handle from the
FileOpen() call, and also an error "Entity Not a Stream". Is it not possible
to open all databases with the File API??
Code:
Err err;
fp = FileOpen(cardNo, nameP, 0, 0, openMode|fileModeAnyTypeCreator, &err);
When this call returns,
fp is not null,
err = 5649 ("Entity not a stream")
>Any comments on where I could be wrong?
>
>Code:
>fp = FileOpen(cardNo, nameP, 0, 0, openMode, NULL);
FROM THE FileStream.h:
#define fileModeReadWrite (0x40000000UL) // create for read/write access,
discarding previous if any */
"DISCARDING PREVIOUS IF ANY" is the key.
Maybe you want Update or Append?
>FileSeek(fp, 0, fileOriginEnd);
This will be 0 if the file has no data in it, or has been cleared by opening
it ReadWrite.
>FileTell(fp, &size, NULL);
FileTell will return the total size in the parameter you have marked as Null
without all those seeks.
>FileSeek(fp, 0, fileOriginBeginning);
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/