Creating and reading an INI file on the Cardputer's SD Card
-
Hi Everyone!
I have been having fun with the m5Cardputer, but am trying to create an INI file for Config settings.
I want to use the mINI file class by metaYeti:
https://github.com/metayeti/mINI
So I've started with this code:
mINI::INIFile file("myfile.ini"); mINI::INIStructure ini; //file.read(ini); ini["section"]["key"] = "value adj"; file.generate(ini); Serial.printf ("Ini section is %s\n",ini.get("section").get("key").c_str()); //file.write(ini); Serial.printf ("Tried to write INI to SD card.\n");
This all compiles and runs - but of course, it doesn't do anything. What baffles me is where the INI file would be created - as there is no path or filesystem set in the example above. I have a feeling I need to do something with a filestream class or something - and somehow make this stream connect with the SD filesystem object or something.
The object is clearly being created - because I can print out the value I set (as shown above).
So can anyone tell me how this can be actually linked to an actual inifile stored in an actual folder!?!
Thanks!