Check out the System Management, File Streaming section of the Palm OS
Programmers API Reference (pp647-666 in my version). Stream files are
specially formatted DM files. You must use FileXXX() functions to
create/access them.

Except for the names for the access functions (FileXXX vs fXXX, eg
FileRead() vs fread()), the parameters and actions of each are very much the
same as they've been since Unix V7 (or even earlier).

--------------------
Jeff Loucks
Work 425-284-1128 [EMAIL PROTECTED]
Mobile 253-691-8812 [EMAIL PROTECTED]
Home 253-851-8908 [EMAIL PROTECTED]
 

-----Original Message-----
From: Kristian Austad [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 24, 2004 2:01 PM
To: Palm Developer Forum
Subject: Problem using FileOpen

I've developed an application with a large database (8mb) that I'm accessing
using DmOpenDataBaseByTypeCreator.

Problem: I want to change the code so that I can access the data in this
file using FileOpen, FileSeek and FileRead insted of simply getting the
handle using DmQueryRecord. Reason: I want more control over the number of
bytes read and where in the file they are read from. DmQueryRecord isn't
flexible enough for my needs. Or are there undiscovered secrets in the
Database Manager that I haven't discovered?

I've played around with FileOpen for ages, but I'm constantly rewarded with
ErrorCode 17; fileErrNotStream, which is bullshit since I know it's a
perfectly valid palm database file. Or could there be something wrong in my
pdb-header and "FileOpen" being more sensitive to this than
"DmOpenDatabase..."? I think it's ridiculous that the Palm developers have
made something as simple as reading from a binary file in memory so hard. On
the PocketPC this all works like charm.

By the way; in FileRead, what is meant by "stream objects?" and "number of
stream objects?" A byte is a byte right??? I think if the Palm developers
invent new terms, it would be nice if they could at least document what they
mean by it.

This is the code that won't work:

FileHand g_file
g_file=FileOpen(0, "appname", 'DATA', 'FsKa', fileModeReadOnly |
fileModeAnyTypeCreator, g_err);

The file "fk.pdb" transferred to the Palm contains a header with "appname",
"DATA" and "FsKA". This file works using Database Manager so I don't think
this is the source of the problem ...?

Any ideas why it won't accept this file as a stream? Answers appreciated...

Kristian






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

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

Reply via email to