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

SPIFFSFS class should not shadow methods in FS class #2750

Closed
judge2005 opened this issue May 6, 2019 · 2 comments
Closed

SPIFFSFS class should not shadow methods in FS class #2750

judge2005 opened this issue May 6, 2019 · 2 comments

Comments

@judge2005
Copy link
Contributor

Please see espressif/esp-idf#3427 for code samples, platform details and discussion. To summarize:

The FS class is not designed to be subclassed insofar as none of its methods are virtual. Re-implementing those methods in SPIFFSFS does not override them, it hides them, so instances of SPIFFSFS can not be passed as references or pointers to the FS class. If they are, the FS methods will be called instead and will not work reliably for a SPIFFS filing system (the existing unit tests are all positive - they test that things work when the files are as they are supposed to be, they don't test negative situations such as files not actually existing).

Instead, an instance of a SPIFFSFS class (such as the instance called SPIFFS) should inject a SPIFFS-specific implementation class into the superclass.

judge2005 added a commit to judge2005/arduino-esp32 that referenced this issue May 9, 2019
@judge2005 judge2005 mentioned this issue May 9, 2019
@judge2005
Copy link
Contributor Author

Created pull request: #2763

@judge2005
Copy link
Contributor Author

judge2005 commented May 14, 2019 via email

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

No branches or pull requests

1 participant