The Filesystem Module provides access to files and directories of a the native filesystem.
Enum to represent the success or error-code of the filesystem_file_* functions
| Enumerator |
|---|
| F_OK |
Everything ok.
|
| F_EOF |
The write/read operation tried to write/read past the end of the file. This is not a fatal error.
|
| F_EACCESS |
The file can not be read/written due to access problems. This is a fatal error.
|
| F_INVALIDPARAM |
You passed invalid parameters to the function.
|
| F_DISKERROR |
A lowlevel disk-error occoured. This is a fatal error.
|
Closes a previously opened directory. Free's all allocated resources.
- Parameters
-
Opens a directory and returns a structure which contains all files/subdirectories.
- See also
- filesystem_dir_close()
- Parameters
-
| path | The absolute path to the directory to open/read |
- Returns
- A Pointer to an initialized DIRECTORY_STRUCT on success, NULL on error
Closes a file.
- Parameters
-
| FILE_HANDLE* filesystem_file_open |
( |
const char * |
filename | ) |
|
Opens a file for read/writing.
- Note
- Depending on the implementation you may only open one file at a time
- Parameters
-
| filename | The absolute file path |
- Returns
- A Pointer to a FILE_HANDLE on success, NULL on error.
Reads some bytes from an open file.
- Parameters
-
- Returns
- F_OK on success, F_EOF if less than
size bytes could be read, an error Code otherwise.
Set's the read/write position to a new position
- Parameters
-
- Returns
- F_OK on success, an error Code otherwise.
Writes some bytes to a open file.
- Note
- Depending on the implementation the file may not be shrinked or expanded.
- Parameters
-
- Returns
- F_OK on success, F_EOF if less than
size bytes could be written, an error Code otherwise.
Initializes the filesystem. Call this method before using any filesystem_* functions
- Returns
- true on success