A collection of useful POSIX wrappers for file / directory handling. More...
#include "fs_utils.h"Functions | |
| bool | path_exists (const char *path) |
| Check whether a path exists. | |
| bool | dir_exists (const char *path) |
| Check whether a directory exists. | |
| bool | file_exists (const char *path) |
| Check whether a file exists. | |
| f_result_t | dir_list (const char *path) |
| List contents of a directory. | |
| f_result_t | file_open (file_t **const file, const char *path, f_mode_t mode) |
| Open a file with the specified mode and initilize a file descriptor. | |
| f_result_t | file_close (file_t **const file) |
| Close an open file from its descriptor. | |
| f_result_t | file_remove (const char *path) |
| Remove a file from the file system. | |
| f_result_t | file_writeline (file_t *const file, const char *const restrict str) |
| Write a null-terminated string to an open file. | |
| f_result_t | file_readline (file_t *const file, char *const restrict buf, size_t n) |
| Read a newline-terminated string from an open file. | |
| f_result_t | file_write (file_t *const file, const void *const restrict data, size_t sz, size_t n) |
| Write raw data to an open file. | |
| f_result_t | file_read (file_t *const file, void *const restrict buf, size_t sz, size_t n) |
| Read raw data from an open file. | |
Variables | |
| static const char * | TAG = "fs" |
A collection of useful POSIX wrappers for file / directory handling.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
static |