Create libioutil, implement a filewriter
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m21s

This commit is contained in:
2026-03-02 22:47:10 +01:00
parent 27afd57427
commit 58c515e90a
28 changed files with 231 additions and 29 deletions

View File

@@ -14,6 +14,7 @@
#include <path_defs.h>
#include <status.h>
#include <sys/debug.h>
#include <write_file.h>
static int fat1_diskio_read (struct fatfs_ctx* ctx, uint32_t sector, uint8_t* buffer,
uint32_t sector_count) {
@@ -196,13 +197,18 @@ int fatfs_read_file (struct vfs_volume* volume, const char* path, uint8_t* buffe
}
int fatfs_write_file (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size) {
size_t size, uint32_t flags) {
struct fatfs_ctx* fatfs_ctx = volume->udata;
if (fl_is_dir (fatfs_ctx, path))
return -ST_NOT_FOUND;
FL_FILE* file = fl_fopen (fatfs_ctx, path, "wb+");
FL_FILE* file;
if ((flags & WF_APPEND))
file = fl_fopen (fatfs_ctx, path, "wb+");
else
file = fl_fopen (fatfs_ctx, path, "wb");
if (file == NULL)
return -ST_NOT_FOUND;