Old 28th July 2006, 02:28   #1
dbarrett
Junior Member
 
Join Date: Jul 2006
Posts: 9
Forcing reload/reread for ReadINIStr?

So far as I can tell, ReadINIStr loads the INI file into memory once, rather than re-reading the file each time its called. This is a sensible optimization.

However, is there any way to force the INI to be re-read, such as after the file is modified?
dbarrett is offline   Reply With Quote
Old 28th July 2006, 02:44   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
try FlushINI
Comperio is offline   Reply With Quote
Old 28th July 2006, 03:45   #3
Mark Nascimento
Member
 
Join Date: Jul 2006
Posts: 82
I tried FlushIni but didn't work.
I did this: The new data is recorded in a new ini or txt file, temporarily created or modified during the initials functions. Then, below in sections, I re-read the results from this temp text. But wait ! there is more and... FREE !
When you run the app again, in the start, before calling this ini file, Read the data from the temp file and write them in your defaut ini file. Nobody will knows, but works.

I've been using this method and never failed yet.
Mark Nascimento is offline   Reply With Quote
Old 29th July 2006, 20:36   #4
dbarrett
Junior Member
 
Join Date: Jul 2006
Posts: 9
Mark -- Great idea. Now I copy the INI to a temp file, read it, and then delete the temp file. Works great.

GetTempFileName $R0
CopyFiles "my.ini" $R0
ReadINIStr $0 $R0 "My Section" "MyName"
Delete $R0

Thanks for the tip!
dbarrett is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump