I tried to enlarge an existing file by positioning the file pointer beyond the end of the file and writing a character there, expecting to have filled the characters in between w/ zeros. The code below works okay under Linux, but fseek fails with errno 5 (EIO) when tried on SPIFFS. Is this a known limitation?
Code:
Code: Select all
#include <stdio.h>
static const char *fname = "rota.log";
FILE *f;
int main(void)
{
f = fopen(fname, "w");
fputs("teststring", f);
fclose(f);
f = fopen(fname, "r+");
fseek(f, 200, SEEK_END);
fputc('Y', f);
fclose(f);
}