mIRC Homepage
Posted By: piker INI file - 23/08/07 08:41 AM
I have a file called piker.ini which contains several settings for my script. My question is, is the .ini file loaded when mirc starts and remains whole in the memory or is it called when needed and that's it?

Posted By: OrionsBelt Re: INI file - 23/08/07 09:40 AM
An ini file is not stored in memory.

Only when you tell mIRC to read ($readini) from the file, you're getting information returned. After that it is up to you what you do with that information. If you save the information to a variable, it will obviously be in memory.

So, nothing is being loaded, unless you tell mIRC to.
Posted By: Bekar Re: INI file - 23/08/07 09:55 AM
Once the information is read, it is cached for a period of time, based on Windows inbuilt INI routines.
Posted By: Horstl Re: INI file - 23/08/07 10:12 AM
Well, mIRC states to cache ini files. There is also that /flushini command:
/flushini <filename>
Flushes the specified INI file to the hard disk. INI files are cached in memory, so you may want to do this to make sure that your INI is updated properly.

I wondered how long and how much of ini data will be "cached in memory".
Of course mIRC will not "load" or "cache" your ini files on its own, as OrionsBelt pointed out. The inidata is storad as "physical" file.

Somewhere I read there is one, but I'm not able to reproduce a measurable time offset between first read attempt of a (large custom) inifile and further read attempts with a script. Maybe someone can clarify this?
Thanks. smile

EDIT: ok, after some time and/or using a "ram defrag" tool, there is a measurable difference:
//var %start = $ticks | echo -a read: $ini($mircini,20) | echo -a $calc($ticks - %start) ticks
//var %start = $ticks | echo -a read: $readini(servers.ini,$ini(servers.ini,2),n0) | echo -a $calc($ticks - %start) ticks

first attempt: 15, 30 or even 120 ticks
second attempt: 0 ticks
Posted By: piker Re: INI file - 24/08/07 01:13 AM
Thanks for your reply that answered exactly what I was after.

© mIRC Discussion Forums