Setting Filesystem #443
Replies: 5 comments
-
You should read the comments in all examples and the Readme doc that already describe how to configure the filesystem. This library is not a single header library that all classes and functions are in only one header file i.e., This is normal approach when you use library that contains many headers and sources files, which all definition macros that used to control the library compilation are included in a header file in the library which user may change it for different compilation options. The macro that defined in That is why Before update the library, you should backup your version of |
Beta Was this translation helpful? Give feedback.
-
Thanks. Yes - i think i understand your advice. Just to be clear - i was not suggesting to replace the #defines in FirebaseFS.h - but to allow the user to flag the filesystem them in their code and avoid editing the FirebaseFS.h. If there was a #define USER_DEFINE_FLAG_LITTLEFS for example - the relevant part of FirebaseFS.h would become :
That way - the user wouldnt have to be editing files in the library (just adding defines in their code before including the firebase client library). Cheers |
Beta Was this translation helpful? Give feedback.
-
As I wrote before, other headers and sources files included in |
Beta Was this translation helpful? Give feedback.
-
Your approach is possible when using with single header library. |
Beta Was this translation helpful? Give feedback.
-
Ahh ok - i get it. Thanks.. For others thinking something similar - i have created the following in my code (not the library)
I define FIREBASE_FS_DEFINED in FirebaseFS.h when i make the change to LittleFS. It's a clunky way to get alerted to the fact i havent modified the file. Cheers |
Beta Was this translation helpful? Give feedback.
-
Hi,
Wanted to propose an option here - I use LittleFS in my ESP8266 code - and a few times now i've migrated environments on my build machine, pulled in a clean copy of the firebase esp client library and it's reset the littlefs customisation in FirebaseFS.h. Then (because i'm slow) i spend a day tracking down issues around the storage.download code only to track back to the FirebaseFS.h using a different filesystem. I think it would be good to define the right library in my code without having to edit the library code.
Currently - FirebaseFS.h automatically defines DEFAULT_FLASH_FS SPIFFS by default. Is it possible to look for some defines before making that default define? e.g. in my code i could define FIREBASE_FS_LITTLEFS (and other options) before including the firebase libraries which the library could then pick up and use the right library without me having to edit the library code. If no defines are found - it could then use the current default settings?
Cheers
Alex
Beta Was this translation helpful? Give feedback.
All reactions