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:
Function | Description |
---|---|
fclose | close the file |
feof | check end of file status |
fflush | flush I/O buffers |
fgetl | read a line |
fgets | read a line |
fprintf | write formatted data |
fread | read data |
fscanf | read formatted data |
fseek | change the current I/O position |
ftell | get the current I/O position |
fwrite | write data |
redirect | redirect output |
Open a file.
fd = filestreamingopen(filename, mode) fd = filestreamingopen(filename, mode, creator) fd = filestreamingopen(card, filename, mode) fd = filestreamingopen(card, filename, mode, creator)
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.
Mode | Meaning |
---|---|
'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).