About the caching this is what Peter Below had to say as a response on an old Delphi posting some time ago:
> >I have a test application written in Delphi v3 C/S that reads values from an > >ini file using tInifile. Every five seconds it performs tinifile.create, > >reads the values and then frees the ini. If I open this ini file in notepad, > >change some of the values and then save and close the file, the test > >application continnues to report the old values. Under Win 95 the test > >application reports the new values as would be expected. On the windows 98 > >machine, some apparently random series of events will force the operating > >system to allow the program to actually re-read the file. Sometimes opening > >another file will do this. Sometimes running another program such as the > >calculator will succeed. It is as if win 98 is caching the file improperly. > >The same problem occurs when the files are stored on a file server. > > > I've fought similar nonsense before, and have never found a > proper answer. Windows (95 & 98) seems to cache files inappropriately > at times. No, the problem happens due to inappropriate use of INI files. These files are meant to be used via the Windows API functions like GetPrivateProfileString, WritePrivateProfileString ONLY (that is what TInifile uses internally). Windows has a special INI file cache that is independent of the normal file system cache to speed up access to INI files via these API functions. Keeping the cache in sync with the disk file is a low priority process since all proper access via the API functions will go to the cache. If you want to mix in access via the normal file functions you have to explicitely flush the INI cache before you do this. The D4 TInifile has an UpdateFile method for this, on earlier versions you have to use WritePrivateProfileString( Nil, Nil, Nil, Pchar( inifilename )); Peter Below (TeamB) [EMAIL PROTECTED]) No replies in private e-mail, please, unless explicitly requested! _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
