libcproject
C static library easier to use than libc (C standard library).
filesystem.h
Go to the documentation of this file.
1 #ifndef __LIBCPROJECT_FILESYSTEM__
2 #define __LIBCPROJECT_FILESYSTEM__
3 
4 #include <dirent.h>
5 #include <errno.h>
6 #include <fcntl.h>
7 #include <pwd.h>
8 #include <stdbool.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <unistd.h>
12 
13 #include "string.h"
14 #include "types.h"
15 
27 int filesystem_read(string_t path, byte_t **file_content, size_t *file_size);
28 
40 int filesystem_write(string_t path, byte_t *file_content, size_t file_size);
41 
50 
62 
73 
74 #endif
int filesystem_read(string_t path, byte_t **file_content, size_t *file_size)
Read the content of a file.
string_t filesystem_get_mimetype(string_t path)
Get the mimetype of a file based on its extension.
int filesystem_remove(string_t path)
Removes a path.
bool filesystem_exists(string_t path)
Check if a path exists.
int filesystem_write(string_t path, byte_t *file_content, size_t file_size)
Write the content to a file.
uint8_t byte_t
Definition: types.h:6
char * string_t
Definition: types.h:8