Generic file handling and path checking functions. More...
Go to the source code of this file.
Macros | |
| #define | MAIN_ERR_PREFIX "FUTIL: " |
| Message prefix for FILEUTILS module. | |
Functions | |
| int | fu_check_path (const char *path) |
| Check path. More... | |
| int | fu_create_path (const char *path, posix_mode_t perm) |
| Create path. More... | |
| int | fu_check_file (const char *pathname, struct_posix_stat *state) |
| Check whether file exist. More... | |
| int | fu_open_file (const char *pathname, int *filedesc, int mode, posix_mode_t perm) |
| Open file. More... | |
| void | fu_close_file (int *filedesc, FILE **stream) |
| Close file (and potentially associated I/O stream) More... | |
| int | fu_lock_file (int filedesc) |
| Lock file for writing. More... | |
| int | fu_unlink_file (const char *pathname) |
| Unlink file. More... | |
| int | fu_assign_stream (int filedesc, FILE **stream, const char *mode) |
| Assign I/O stream to open file. More... | |
| int | fu_sync (int filedesc, FILE *stream) |
| Flush buffers of file. More... | |
| int | fu_read_whole_file (int filedesc, char **buffer, size_t *len) |
| Read text file content and store it into memory buffer. More... | |
| int | fu_read_from_filedesc (int filedesc, char *buffer, size_t *len) |
| Read data block to filedescriptor. More... | |
| int | fu_write_to_filedesc (int filedesc, const char *buffer, size_t len) |
| Write data block to filedescriptor. More... | |
| int | fu_delete_tree (const char *dir) |
| Delete directory tree. More... | |
Generic file handling and path checking functions.
Copyright (c) 2012-2021 by the developers. See the LICENSE file for details.
If nothing else is specified, functions return zero to indicate success and a negative value to indicate an error.
Definition in file fileutils.c.