Skip to content
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

Return FALSE on seek past EOF #7324

Merged
merged 3 commits into from
May 31, 2020
Merged

Conversation

earlephilhower
Copy link
Collaborator

Fixes #7323

While I'm not a fan, the Arduino FileSeek API online shows that a seek()
past EOF should return FALSE.
https://www.arduino.cc/en/Reference/FileSeek

SPIFFS and SDFS obey this, but LittleFS followed the POSIX standard of
allowing seeks past EOF.

Update LittleFS::seek() to follow the Arduino API and add tests for it.

Fixes esp8266#7323

While I'm not a fan, the Arduino FileSeek API online shows that a seek()
past EOF should return FALSE.
https://www.arduino.cc/en/Reference/FileSeek

SPIFFS and SDFS obey this, but LittleFS followed the POSIX standard or
allowing seeks past EOF.

Update LittleFS::seek() to follow the Arduino API and add tests for it.
@earlephilhower earlephilhower added this to the 2.7.2 milestone May 24, 2020
@earlephilhower earlephilhower merged commit 8ee67ab into esp8266:master May 31, 2020
@earlephilhower earlephilhower deleted the lfsseek branch May 31, 2020 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

file.seek problem
2 participants