stevemarple / IniFile

Arduino library to parse ini files.
GNU Lesser General Public License v2.1
87 stars 45 forks source link

Delete contents #37

Closed ADJ7WTB closed 1 year ago

ADJ7WTB commented 1 year ago

Very weird problem. I added setings in the data file. Upload the code but reads nothing from the file. Open file on PC and the content is missing. Some how the data gets deleted.

stevemarple commented 1 year ago

The IniFile object can (and should) be created with the file mode set to read. That will prevent IniFile from writing to the file.

ADJ7WTB commented 1 year ago

Thanks. Problem is that is cleared the file completely.

stevemarple commented 1 year ago

IniFile only requires read so set the mode to read. Opening an existing file with write mode (not append) will truncate the file.