View Full Version : how to clear text from a text file with LUA?

August 9th, 2006, 05:21 AM
Hi all,

I have a lua script that checks for a certain string in a log file. So far so good. What I'd like to do is to clear the text from the log file after it's been checked by the previous script. I want to avoid it getting too big. So thats my question: lua script for clearing a text file.

August 9th, 2006, 05:14 PM

this can be done by simply opening or re-opening the file in "w+" mode depending on when you want to erase all previous data stored in the file.

hope this helps ;)

August 9th, 2006, 06:14 PM
Thank you for the tip. Sadly, I dont know what w+ mode is nor how to implement it in a script. I hope you can provide some additional info. Thanks.