FlushPreferenceBuffer()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

FlushPreferenceBuffer()

Post by leonhardt »

If there is a command like this:
FlushPreferenceBuffer(Preference),then when I crashed my app by accident, I won't lost all my writing to the preference file.
Now I must call ClosePreferences() every time after writing data accomplished just in case,while I need to write data some other time I need to call OpenPreferences() again, a little cost in performance huh?
poor English...

PureBasic & Delphi & VBA
juror
Enthusiast
Enthusiast
Posts: 228
Joined: Mon Jul 09, 2007 4:47 pm
Location: Courthouse

Re: FlushPreferenceBuffer()

Post by juror »

leonhardt wrote: Now I must call ClosePreferences() every time after writing data accomplished just in case
Alas, even closing the file does not result in the buffers being flushed should the program terminate abnormally subsequently. Some way to ensure the integrity of the preferences file is needed.

+1
Julian
Enthusiast
Enthusiast
Posts: 276
Joined: Tue May 24, 2011 1:36 pm

Re: FlushPreferenceBuffer()

Post by Julian »

+1 Either that or return a normal file number when using OpenPreferences & CreatePreferences so we can use FlushFileBuffers(#File)
Post Reply