Fix FAT driver file modes, update filewriter accordingly
Some checks failed
Build documentation / build-and-deploy (push) Has been cancelled

This commit is contained in:
2026-03-15 20:18:50 +01:00
parent d7bfc5c8fd
commit af966b5405
5 changed files with 30 additions and 20 deletions

View File

@@ -426,12 +426,19 @@ static void execute_redir (struct ast_redir* redir, struct context* context) {
return;
}
uint32_t fw_flags = FW_CREATE_FILE | FW_TRUNCATE;
struct filewriter fw;
if ((ret = filewriter_init (&fw, volume, path, FW_CREATE_FILE | FW_APPEND)) < 0) {
if ((ret = filewriter_init (&fw, volume, path, fw_flags)) < 0) {
cprintf (context, "ERROR could not initialize filewriter for '%s:%s'\n", volume, path);
return;
}
if (context->strbuf.count == 0) {
filewriter_fini (&fw);
return;
}
size_t chunk_size = 1024;
size_t chunks = (context->strbuf.count - 1) / chunk_size;
size_t rem = (context->strbuf.count - 1) % chunk_size;