Article View: comp.windows.ms.programmer
Article #1751GetPrivateProfileString and fprintf() woes
From: Paul Bonneau
Date: Wed, 20 Mar 1991 19:12
Date: Wed, 20 Mar 1991 19:12
21 lines
1185 bytes
1185 bytes
Hi all, This is my problem. I am getting stuff from a private .ini file using GetPrivateProfileString(). When it comes time to write it out, so many things have changed, that it is much faster to simply recreate the file with a series of fprintf()'s than WritePrivateProfileStrings()'s. Problem is, apparently windows buffers the .ini file, so that GetPrivateProfileString() is faster. But on the next invocation of the program, the old buffer is being reused, so that the new .ini file (created with fprintf()'s) is not being read. Anybody else come up against this problem? Have any suggestions? Currently, I am calling GlobalCompact(-1) to flush all discardable segments, which flushes the segment containing the buffered memory. As you can imagine, this causes a few disk hits to reload everything (;->). cheers - Paul Bonneau.
Technical Details
Message-ID:
<1991Mar20.191244.12821@hyper.hyper.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneauShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau From: bonneau@hyper.hyper.com (Paul Bonneau) Subject: GetPrivateProfileString and fprintf() woes Message-ID: <1991Mar20.191244.12821@hyper.hyper.com> Organization: HyperCube Inc. Date: Wed, 20 Mar 1991 19:12:44 GMT