I am copying a default version of the prefs file into a string during compilation. When the constructor is called (i.e. runtime), I detect the absence of a file and copy the default file.
Can I confirm that the prefs file is created *ONLY* after the first read (i.e. get()) call ?
prefs = Fl_Preferences(Fl_Preferences::USER, vendor, product);
will not create a prefs file until the first
prefs.get() or prefs.set()
On Saturday, April 25, 2015 at 12:46:47 PM UTC+5:30 Matthias Melcher wrote:
Why does reading a value create a file? Well, I saw the preferences as a database, and tried to provide database access, not file access (this is why I never published the format of the file or the location. It simply should not matter). Reading an entry creates the entire database structure and file. You can mix reading and writing calls at any time. It's always random access, so it always requires the infrastructure.
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/1ed40daa-b138-4a2c-bb3c-09d2211773ccn%40googlegroups.com.
[ Direct Link to Message ]