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

Fix FileStream write caching #1680

Merged
merged 2 commits into from
May 4, 2019

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented May 3, 2019

Add position check in FileStream::write before calling fileSeek to avoid flushing SPIFFS write cache.

Fixes #1679

@slaff slaff added this to the 3.9.0 milestone May 3, 2019
@slaff
Copy link
Contributor

slaff commented May 3, 2019

@mikee47 Is this PR tested and ready to merge?

@mikee47
Copy link
Contributor Author

mikee47 commented May 3, 2019

@slaff Yes, I've tested this fix and happy with it for now, but generally I think we need to take another look at streams to ensure they all behave consistently, probably document behaviour a little better. Some of the streams are 'forward-only' (e.g. StreamTransformer-based ones) whilst others support proper seeking (FileStream does, MemoryDataStream should but doesn't, etc.). Opening a FileStream for read/write definitely needs clarifying - expected behaviour would be for write to happen at the current position, but it doesn't.

@slaff slaff merged commit abfabf6 into SmingHub:develop May 4, 2019
@mikee47 mikee47 deleted the fix/FileStream_write_caching branch May 4, 2019 13:32
@slaff slaff removed the 3 - Review label Jun 4, 2019
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.

SPIFFS write caching not working with FileStream
2 participants