Fix FAT driver file modes, update filewriter accordingly
Some checks failed
Build documentation / build-and-deploy (push) Has been cancelled
Some checks failed
Build documentation / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -227,10 +227,11 @@ DEFINE_VFS_WRITE_FILE (fatfs_write_file) {
|
||||
|
||||
FL_FILE* file;
|
||||
|
||||
if ((flags & WF_APPEND))
|
||||
if ((flags & WF_TRUNCATE) && off == 0) {
|
||||
file = fl_fopen (fatfs_ctx, path, "wb+");
|
||||
} else {
|
||||
file = fl_fopen (fatfs_ctx, path, "rb+");
|
||||
else
|
||||
file = fl_fopen (fatfs_ctx, path, "wb");
|
||||
}
|
||||
|
||||
if (file == NULL)
|
||||
return -ST_NOT_FOUND;
|
||||
@@ -276,7 +277,7 @@ DEFINE_VFS_CREATE_FILE (fatfs_create_file) {
|
||||
fatfs_ctx->proc = proc;
|
||||
fatfs_ctx->rctx = rctx;
|
||||
|
||||
FL_FILE* file = fl_fopen (fatfs_ctx, path, "wb+");
|
||||
FL_FILE* file = fl_fopen (fatfs_ctx, path, "ab+");
|
||||
|
||||
if (file == NULL)
|
||||
return -ST_NOT_FOUND;
|
||||
|
||||
Reference in New Issue
Block a user