#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "string.h"
#include "types.h"
Go to the source code of this file.
◆ filesystem_read()
int filesystem_read |
( |
string_t |
path, |
|
|
byte_t ** |
file_content, |
|
|
size_t * |
file_size |
|
) |
| |
Read the content of a file.
- Parameters
-
path | |
file_content | |
file_size | The size of the file that was read (mutated by the function). |
- Return values
-
-1 | if the file does not exist or if there is an error. |
0 | for success. |
- Returns
- int
- Since
- v1.0.0
◆ filesystem_write()
int filesystem_write |
( |
string_t |
path, |
|
|
byte_t * |
file_content, |
|
|
size_t |
file_size |
|
) |
| |
Write the content to a file.
- Parameters
-
path | |
file_content | |
file_size | |
- Return values
-
-1 | if there is an error. |
0 | for success. |
- Returns
- int
- Since
- v1.0.0
◆ filesystem_exists()
Check if a path exists.
- Parameters
-
- Returns
- bool
- Since
- v3.1.0
◆ filesystem_remove()
Removes a path.
- Parameters
-
- Returns
- int
- Return values
-
-1 | if there is an error. |
0 | for success. |
- Returns
- int
- Since
- v3.1.0
◆ filesystem_get_mimetype()