File system abstraction layer for lightweight embedded & host storage. More...
#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Go to the source code of this file.
Data Structures | |
| struct | fs_file_t |
| File and directory metadata. More... | |
Macros | |
| #define | FS_PATH_MAX 255 |
| Maximum length of a single path component. | |
| #define | FS_PATH_SEPARATOR '/' |
| Path separator character. | |
Typedefs | |
| typedef struct fs_volume_t | fs_volume_t |
| Opaque filesystem volume handle. | |
Functions | |
Volume management | |
| fs_volume_t * | fs_vol_init_memory (size_t size) |
| Create a new volatile (RAM) filesystem volume. More... | |
| fs_volume_t * | fs_vol_init_file (const char *path, size_t size) |
| Open or create a host file–backed persistent volume. More... | |
| fs_volume_t * | fs_vol_init_flash (size_t size) |
| Open or create a non-volatile flash-backed persistent volume. More... | |
| void | fs_vol_finalize (fs_volume_t *volume) |
| Unmount and release all resources for a volume. More... | |
| size_t | fs_vol_size (fs_volume_t *volume, size_t *free) |
| Return total addressable size of a mounted volume. More... | |
| bool | fs_vol_readdir (fs_volume_t *volume, const char *path, fs_file_t *iterator) |
| Iterate directory entries. More... | |
| fs_file_t | fs_vol_stat (fs_volume_t *volume, const char *path) |
| Lookup file or directory metadata for a path. More... | |
| bool | fs_vol_mkdir (fs_volume_t *volume, const char *path) |
| Create a directory. More... | |
| bool | fs_vol_remove (fs_volume_t *volume, const char *path) |
| Remove a file or (empty) directory. More... | |
| bool | fs_vol_move (fs_volume_t *volume, const char *old_path, const char *new_path) |
| Move or rename a file/directory. More... | |
File management | |
| fs_file_t | fs_file_create (fs_volume_t *volume, const char *path) |
| Create a new file or truncate an existing file to zero length. More... | |
| fs_file_t | fs_file_open (fs_volume_t *volume, const char *path, bool write) |
| Open an existing file for read/write. More... | |
| bool | fs_file_close (fs_file_t *file) |
| Close an opened file. More... | |
| size_t | fs_file_read (fs_file_t *file, void *buffer, size_t size) |
| Read data from an opened file. More... | |
| size_t | fs_file_write (fs_file_t *file, const void *buffer, size_t size) |
| Write data to an opened file. More... | |
| bool | fs_file_seek (fs_file_t *file, size_t offset) |
| Seek to a position within an opened file. More... | |
File system abstraction layer for lightweight embedded & host storage.
Definition in file fs.h.