Whatever file i try to open, when i read it i get null.
struct stat st;
ESP_LOGI(TAG, "index.html size is %ld", st.st_size);
ESP_LOGI(TAG, "Reading file");
FILE* f = fopen("/spiffs/index.html", "r");
fgets(line, sizeof(line), f);
ESP_LOGI(TAG, "Read from file: '%s'", line);
this code produces the following log:
I (435) wifi softAP: index.html size is 546
I (437) wifi softAP: Reading file
I (444) wifi softAP: Read from file: ''
i have generated the image with mkspiffs. i also have tryed recompiling mkspiffs with SPIFFS_USE_MAGIC_LENGTH: 4 instead of 1 but nothing changes.