I’m writing to the filesystem and want to check the file size using stat method (https://docs.particle.io/reference/device-os/firmware/boron/#file-system-stat )
If the file doesnt exist, it returns the -1, but if it exists it seems to show the same size of the file: 1591.
Code is like this:
success = stat(FILE_NAME, fileStatBuffer);
Log.info (“File stat success %d”, success);
if (success != -1)
success = (int)(fileStatBuffer->st_size);
Log.info (“File size %d”, success);
Is it something obvious I’m missing?