JohnOne Posted August 9, 2011 Share Posted August 9, 2011 (edited) After a recent topic, I started farting about with .ini files to see if the work with a file handle returned by FileOpen. They do, but do not seem to be any quicker, and most of the time, slower. I'm just a little curious as to why this is, if anyone knows? It seems a lot faster with FileWrite. Here's the script I used. $sfile = @ScriptDir & "\test.ini" ;$hfile = FileOpen(@ScriptDir & "\test.ini",1) Sleep(2000); just to give the interpreter a chance to start up $timer = TimerInit() For $i = 0 To 1000 IniWrite($sfile,$i,$i,$i); Change to $hfile Next ConsoleWrite(TimerDiff($timer) & @CRLF) And my results I tried more than a few times. filename = 1948.78538678726 filehandle = 1995.27468244446 EDIT: I think I used to few writes, I tried with 5000 this time and the results were what I expected. ;filename = 16165.4754829552 ;filehandle = 19510.1253164002 EDIT2: Wait, No, filename was 3 seconds faster Edited August 9, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 9, 2011 Developers Share Posted August 9, 2011 (edited) Are you sure the INIWrite(FileHandle,,) works? $sfile = @ScriptDir & "\xxxx1.ini" $hfile = FileOpen(@ScriptDir & "\xxxx2.ini",1) Sleep(200); just to give the interpreter a chance to start up $timer = TimerInit() For $i = 0 To 1000 IniWrite($sfile,$i,$i,$i) IniWrite($hfile,$i,$i,$i) Next ConsoleWrite(TimerDiff($timer) & @CRLF) Edited August 9, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
JohnOne Posted August 9, 2011 Author Share Posted August 9, 2011 Not now I'm not I was just a minute ago though. Cheers Jos. <slinks out of thread> AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now