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");