mIRC Home    About    Download    Register    News    Help

Print Thread
#225071 25/08/10 01:48 AM
Joined: Jan 2009
Posts: 116
K
Knoeki Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2009
Posts: 116
I was wondering how mIRC writes to files, in this case, .ini files specifically. It seems that it takes a while for mIRC to catch up, which I found out because of the script I'm writing.

What it does is:

- loop through files to load;
- load each file;
- send signal -n to loaded file to initialize (immeditately)

when the file recieves the signal, it checks if the configuration for that file exists. If it doesn't, it will generate defaults, and then send a signal -n to itself to re-initialize.

What's supposed to happen, is that it re-checks if the file exists, which is now the case, and then load the settings from them into a hashtable.

However, it seems that mIRC will repeatedly generate the defaults, as checking if the file exists fails. This goes both for $exists() and $file().

The solution I have right now is to insert a pause of 500ms (by using whilefix) and then sending the initialize signal again. At that point the file check doesn't fail.

Just curious how/why this is. :_)

EDIT: I should probably mention that I don't recall having this issue with 6.35, although there might be various reasons for that. It just seems that writeini is delayed in general.

Last edited by Knoeki; 25/08/10 02:21 AM.
Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
/help /flushini

Joined: Jan 2009
Posts: 116
K
Knoeki Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2009
Posts: 116
Ahahahaha, typical of me to overlook those kind of things. Cheers! \o/

Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
You're welcome smile


Link Copied to Clipboard