-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zero-size files cannot be read #44
Comments
code: FILE *f = fopen("fs2.spiffs", "r");
int n = fread(image, 1, image_size, f);
printf("%d bytes\n", n);
mem_spiffs_mount(); /* this mounts SPIFFS at global fs variable */
char x[1000];
int sfd = SPIFFS_open(&fs, "0.bytes", SPIFFS_RDONLY, 0);
printf("sfd = %d\n", sfd);
int nr = SPIFFS_read(&fs, sfd, x, 100);
printf("nr = %d errno = %d\n", nr, SPIFFS_errno(&fs)); output:
if i change it to read
|
Ah, good finding! Hadn't thought of that. Will fix after next week, on a Cheers!
|
An empty file (zero bytes) can be successfully written but cannot be read.
The errno returned is -10015 (SPIFFS_ERR_INDEX_REF_FREE)
The text was updated successfully, but these errors were encountered: