This project contains code for the Filesystem abstraction layer.
void fs_init(int f, int partition, fs_driver_t *driver);
void fs_start();
fs_fd fs_open(int f, char *path, uint32_t flags);
int32_t fs_read(int f, fs_fd fd, void *buf, int32_t count);
int32_t fs_write(int f, fs_fd fd, const void *buf, int32_t count);
void fs_flush(int f, fs_fd fd);
void fs_close(int f, fs_fd fd);
void fs_unlink(int f, char *path);
int32_t fs_lseek(int f, fs_fd fd, int32_t offs, int whence);
int32_t fs_fstat(int f, fs_fd fd, fs_stat *s);
int32_t fs_write_record (int file_sys_nr, const char * p_file_name, const void * p_value, int32_t len, fs_rw_done_f callback_func, uint32_t wait)
int32_t fs_read_record (int file_sys_nr, const char * p_file_name, void * p_value, int32_t len, fs_rw_done_f callback_func, uint32_t wait)
FS_MAX_COUNT - Number of supported filesystems, defaults to 1, but more can be supported, for example to have a backup filesystem with critical system settings.
FS_MAX_DESCRIPTORS - Number of files that can be open at the same time, defaults to 6. Should be slightly larger than the actual number of files you intend to keep open or spontaneously access from multiple threads, as the descriptors may not become immediately available for re-use.
Thinnect LowLevelLogging (submodule, MIT license) Thinnect node-platform & buildsystem components. SPIFFS (SPI Flash File System) https://github.com/pellepl/spiffs
See the example directory.