1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2024-12-11 21:13:00 +01:00

feat: add filesystem_remove

This commit is contained in:
Théo LUDWIG 2023-08-06 12:14:13 +02:00
parent ad0a460923
commit dff2836bfc
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
2 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,10 @@ bool filesystem_exists(string_t path) {
return access(path, F_OK) == 0;
}
int filesystem_remove(string_t path) {
return remove(path);
}
string_t filesystem_get_mimetype(string_t path) {
if (string_ends_with(path, ".html")) {
return "text/html";

View File

@ -47,6 +47,17 @@ int filesystem_write(string_t path, byte_t *file_content, off_t file_size);
*/
bool filesystem_exists(string_t path);
/**
* @brief Removes a path.
*
* @param path
* @return int
* @retval -1 if there is an error.
* @retval 0 for success.
* @since v3.1.0
*/
int filesystem_remove(string_t path);
/**
* @brief Get the mimetype of a file.
*