From c2726bc2618ab0db6fd5096556293b6eb846bbc0 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Mon, 9 Mar 2026 02:00:14 +0100 Subject: [PATCH] FAT driver fix file modes --- kernel/fs/fatfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/fs/fatfs.c b/kernel/fs/fatfs.c index 5fb3cb5..c627927 100644 --- a/kernel/fs/fatfs.c +++ b/kernel/fs/fatfs.c @@ -183,7 +183,7 @@ int fatfs_read_file (struct vfs_volume* volume, const char* path, uint8_t* buffe if (fl_is_dir (fatfs_ctx, path)) return -ST_NOT_FOUND; - FL_FILE* file = fl_fopen (fatfs_ctx, path, "wb+"); + FL_FILE* file = fl_fopen (fatfs_ctx, path, "rb"); if (file == NULL) return -ST_NOT_FOUND; @@ -206,7 +206,7 @@ int fatfs_write_file (struct vfs_volume* volume, const char* path, uint8_t* buff FL_FILE* file; if ((flags & WF_APPEND)) - file = fl_fopen (fatfs_ctx, path, "wb+"); + file = fl_fopen (fatfs_ctx, path, "rb+"); else file = fl_fopen (fatfs_ctx, path, "wb");