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

LittleFS timestamp last write is also changed after a file is only read. #6955

Closed
NicoZuid opened this issue Dec 28, 2019 · 0 comments · Fixed by #6956
Closed

LittleFS timestamp last write is also changed after a file is only read. #6955

NicoZuid opened this issue Dec 28, 2019 · 0 comments · Fixed by #6956
Assignees
Milestone

Comments

@NicoZuid
Copy link

NicoZuid commented Dec 28, 2019

LittleFS timestamp last write is also changed after a file is only read.
Easy to test with example LittleFS_Timestamp.
Place a delay (60000) for the last lines with:
readFile ("/ hello.txt"); listDir ("/");

@NicoZuid NicoZuid changed the title LittleFS timetamp last write is also changed after a file is only read. LittleFS timestamp last write is also changed after a file is only read. Dec 28, 2019
@earlephilhower earlephilhower added this to the 2.7.0 milestone Dec 28, 2019
earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Dec 28, 2019
Fixes esp8266#6955

LittleFS was updating the timestamp on any close, not only for files
when they were opened for writing.  This could lead to excessive writes
to the flash.

Preserve the LFS flags, and only update the timestamp if the file was
opened for writing.
@earlephilhower earlephilhower self-assigned this Dec 29, 2019
earlephilhower added a commit that referenced this issue Dec 30, 2019
Fixes #6955

LittleFS was updating the timestamp on any close, not only for files
when they were opened for writing.  This could lead to excessive writes
to the flash.

Preserve the LFS flags, and only update the timestamp if the file was
opened for writing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants