Maybe I need a coffee...but I cannot truncate a file using FatFS/POSIX or anything I can put my hands on...
Simple example of what I'm trying to achieve (assume file is 100B).
Code: Select all
FILE *f = fopen(file_path, "r+");
fseek(f,-20,SEEK_END);
truncate(f,0);
fflush(f);
f_sync(f);
abort();