Board index » kylix » ini files (big problem)

ini files (big problem)


2003-11-19 03:24:58 AM
kylix1
Hi,
I have 7 daemons and all off them read some info from *the same* 2 ini
files:
locals.ini
settings.ini
the problem is, when one of the daemons open the ini file the is deleting
all the content of the file for a second, then the content is back
sometimes, and some times the file size remains 0 and the info is lost. What
is wrong? I'm using TIniFile to open and read my ini file.
ini := TIniFile.Create(name);
try
// read the info
finally
ini.Free;
end;
I tried to use ini.UpdateFile before ini.Free but with same results.
-ioan
 
 

Re:ini files (big problem)

Ioan Ghip wrote:
Quote
What is wrong?
Have you tried TMemIniFile? What about a semaphore to synchronize
read/write access?
--
Regards
Andreas Hausladen
 

Re:ini files (big problem)

Quote

Have you tried TMemIniFile? What about a semaphore to synchronize
read/write access?
I will try right now with TMemIniFile. I have no idea how to use semaphore,
do you have any examples?
-i
 

{smallsort}

Re:ini files (big problem)

IG>I have 7 daemons and all off them read some info from *the same* 2
IG>ini files:
IG>locals.ini settings.ini the problem is, when one of the daemons open
IG>the ini file the is deleting all the content of the file for a
IG>second, then the content is back sometimes, and some times the file
IG>size remains 0 and the info is lost. What is wrong? I'm using
IG>TIniFile to open and read my ini file.
TIniFile keeps contents of ini file in memory. When it going to destroy it
write contents to disk. Use TMemIniFile instead.
---
Andrew V. Fionik, Papillon Systems, Unix Programmers Group
For reply use "ender" instead of "fionika" in e-mail.