Files
[Platform Abstraction]


Functions

File fileOpen (const Char *path, const Char *access)
void fileClose (File file)
bool fileEOF (File file)
unsigned fileRead (File file, void *buffer, unsigned num)
unsigned fileWrite (File file, void *buffer, unsigned num)
bool fileFlush (File file)
bool fileSeek (File file, int offset, int origin)
unsigned fileTell (File file)
bool fileExists (const Char *file)

Function Documentation

void fileClose File    file
 

Close a file.

bool fileEOF File    file
 

Determine if a file has reached it's end.

bool fileExists const Char   file
 

Determine if a given file exists and is accessible.

bool fileFlush File    file
 

Flush all buffered output to the file.

Parameters:
file  The file to flush.
Returns:
True if successful, false if an error occurred.

File fileOpen const Char   path,
const Char   access
 

Open a file.

Parameters:
path  The path of the file.
access  One of the following string values: "in" for input only, "out" for output only (existing file will be lost), "inout" for both input and output (existing file will be overwritten but not lost).
Returns:
A new file object or NULL on error.

unsigned fileRead File    file,
void *    buffer,
unsigned    num
 

Read raw bytes from a file.

Parameters:
file  The file to read from.
buffer  A buffer to hold the data as it is read.
num  The number of bytes to read.
Returns:
The number of bytes actually read.

bool fileSeek File    file,
int    offset,
int    origin
 

Move the file's current read/write position.

Parameters:
file  The file object.
offset  The new read/write offset from the specified origin.
origin  One of the constants FILE_START, FILE_CURRENT, or FILE_END.
Returns:
True if successful, false on error.

unsigned fileTell File    file
 

Get a file's current read/write position.

unsigned fileWrite File    file,
void *    buffer,
unsigned    num
 

Write raw bytes into a file.

Parameters:
file  The file to write into.
buffer  The bytes to be written.
num  The number of bytes to write.
Returns:
The number of bytes actually written.


Flat Four Engine
Copyright (C) 2001 by 379, Inc.
This page generated by Doxygen