File Streaming Functions

Palm OS provides a set of functions to simulate files on top of databases. Function filestreamingopen is used to create or open these files. Input, output, and control are done with the following generic functions:

FunctionDescription
fcloseclose the file
feofcheck end of file status
fflushflush I/O buffers
fgetlread a line
fgetsread a line
fprintfwrite formatted data
freadread data
fscanfread formatted data
fseekchange the current I/O position
ftellget the current I/O position
fwritewrite data
redirectredirect output

filestreamingopen

Open a file.

Syntax

fd = filestreamingopen(filename, mode)
fd = filestreamingopen(filename, mode, creator)
fd = filestreamingopen(card, filename, mode)
fd = filestreamingopen(card, filename, mode, creator)

Description

filestreamingopen(filename,mode) opens the file whose name is filename for reading and/or writing. Mode is a single-character string, whose meaning is described below.

ModeMeaning
'r'read-only
'w'read/write (reset file contents)
'u'update (keep file contents, seek to beginning)
'a'add (keep file contents, seek to end)

filestreamingopen(filename,mode,creator) sets the creator to the four-character string creator. The default is 'LyME'.

filestreamingopen(card,...), where card is an integer number, specifies the card where the file is stored. The default is 0 (internal memory).

See also

fclose


Copyright 2003-2007, Calerga.
All rights reserved.