file.h File Reference
#include "fvstypes.h"
Go to the source code of this file.
Typedef Documentation
|
The implementation of the object is private and must not be known by the user. Use this handle to manipulate the file through the functions provided hereunder. |
typedef enum FvsFileOptions_t FvsFileOptions_t
|
|
|
File options that can be used with the FileOpen function. |
Enumeration Type Documentation
|
File options that can be used with the FileOpen function. - Enumeration values:
-
FvsFileRead |
Open for reading |
FvsFileWrite |
Open for writing |
FvsFileCreate |
Create if the file does not exist |
|
Function Documentation
|
Create a new file object. Only after having being created, can the file object be used by the other functions. - Returns:
- NULL if allocation failed, otherwise a new object handle.
|
|
Destroy an existing file object. After having been destructed, the file object cannot be used anymore. - Parameters:
-
file | a pointer to a file object to delete |
- Returns:
- nothing
|
|
Open a file. A file can be opened for reading (it must then exist). It can also be opened for writing and an empty file may be created. Read and Write operations can only be performed on open files. - Parameters:
-
file | a file object |
name | name of the file to open |
flags | open flags |
- Returns:
- an error code
|
|
Close an open file. After having been closed, the file operations cannot be used anymore. - Parameters:
-
- Returns:
- an error code
|
|
Read data from the file. The amount of bytes to be read is specified by length. The data read will be stored into the location pointed by data. - Parameters:
-
file | a file object |
data | pointer to an array where the data will be stored |
length | number of bytes to read from the file |
- Returns:
- the number of bytes read
|
|
Write data to the file. The amount of data to be written is specified by length. The data to write is stored into the location pointed to by data. - Parameters:
-
file | a file object |
data | pointer to an array where the data is stored |
length | number of bytes to write to the file |
- Returns:
- the number of bytes written
|
|
Get a byte from the file. - Parameters:
-
- Returns:
- the byte read
|
|
Get a word from the file. - Parameters:
-
- Returns:
- the word read
|
|
Test if a file is open. - Parameters:
-
- Returns:
- a boolean value true when the file is open
|
|
Test if the file pointer is currently at the end of the file. - Parameters:
-
- Returns:
- a boolean value true when EOF is reached
|
|
Commit the changes made to the file. - Parameters:
-
- Returns:
- an error code
|
|
Seek to the begin of the file. - Parameters:
-
- Returns:
- an error code
|
|
Seek to the end of the file. - Parameters:
-
- Returns:
- an error code
|
|
Seek to a given position. - Parameters:
-
file | a file object |
position | the new file pointer position from beginning of the file |
- Returns:
- an error code
|
|
Get the current position in the file. - Parameters:
-
- Returns:
- the current position
|