Hi list Off topic, but I am sure there is a better way to do what I'm doing.
As my test script runs, I have a script which reads the windows event log every 5 minutes and produces three flat files with the output according to different criteria. The way I read the logs is with Microsoft's dumpel.exe utility which is called with system() and parameters from ruby. But, I need a continuous log file, so at the beginning of the script I create a master log file. Everytime the three new temp log files are written, I read the data into an array. I also read the master log file into an array. Then I have a simple if: oldbuffer = logfile.to_a newbuffer = nil newbuffer = rebootedarray.to_a | clearedarray.to_a | temparray.to_a newbuffer.each {|item| if not oldbuffer.include?(item) oldbuffer.push(item) if item > ' ' end } logfile.truncate 0 oldbuffer = oldbuffer.sort.uniq logfile.puts(oldbuffer) The new array replaces all the data previously in the master log file. I get a lot of redundant whitespace for some reason. It really is a hack - there must be a better way to do it... Walter Kruse Senior Test Analyst www.OBS-Consulting.com 082 660 7288 http://www.ou-ryperd.net ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. **************************************************************************************************************************
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general