jterwelp Posted November 10, 2006 Share Posted November 10, 2006 Short of using a FileOpen() and FileClose() before and after each FileWriteLine(), is there any way to get around the FileWriteLine() buffer behavior? It seems to buffer 8KB of data (or multiples thereof) before it actually commits it to the file. I have an AutoIt 3.2.0.1 script which writes to a log file. If the PC is rebooted while the script is running, none of the lines that I attempted to write using FileWriteLine() appear in the log file. Please let me know if posting a sample script to illustrate this behavior would be helpful. Thanks, Jeff Link to comment Share on other sites More sharing options...
Xenobiologist Posted November 10, 2006 Share Posted November 10, 2006 Hi, what are you trying to accomplish? What is the problem to solve? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
jterwelp Posted November 10, 2006 Author Share Posted November 10, 2006 what are you trying to accomplish? What is the problem to solve?When I call FileWriteLine(), I want the data to appear in the log file immediately without having to close and reopen the file each time I write another line.Jeff Link to comment Share on other sites More sharing options...
Developers Jos Posted November 10, 2006 Developers Share Posted November 10, 2006 (edited) When I call FileWriteLine(), I want the data to appear in the log file immediately without having to close and reopen the file each time I write another line.JeffUse FileWriteLine() without opening and closing the file ...Just specify the filename in the the function and the rest will be taken care of. Edited November 10, 2006 by JdeB 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...
jterwelp Posted November 10, 2006 Author Share Posted November 10, 2006 Just specify the filename in the the function and the rest will be taken care of.I believe that using a filename with FileWriteLine() is functionally equivalent to using a file handle with a FileOpen() and FileClose() but, you're right, this approach will definitely make my code cleaner. I generally try to avoid using a filename with FileWriteLine() but it may be the best solution in this case. Thank you for the idea.Jeff Link to comment Share on other sites More sharing options...
Developers Jos Posted November 10, 2006 Developers Share Posted November 10, 2006 I believe that using a filename with FileWriteLine() is functionally equivalent to using a file handle with a FileOpen() and FileClose() but, you're right, this approach will definitely make my code cleaner. I generally try to avoid using a filename with FileWriteLine() but it may be the best solution in this case. Thank you for the idea.JeffCorrect...The only way you can assure that the information is actually written is to close the file ... 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...
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