Shane Emmons wrote:
> On Fri, Nov 21, 2008 at 4:41 PM, Mmcolli00 Mom 
> <mmc_collins / yahoo.com>wrote:
> 
>> 'completed' starttime 05:00 endtime 23:00
>>
> File.open('logfile.txt', 'w+') do |f1|  f1.write(logline)
> end
This will destroy the content of logfile.txt. For appending to a file 
instead of overwriting it, use "a"

3.times do |n|
  logline = "logline #{n}"
  File.open('D:/temp/logfile1.txt', 'w+') do |f1|
    f1.puts(logline)
  end
  File.open('D:/temp/logfile2.txt', 'a') do |f1|
    f1.puts(logline)
  end
end

hth,

Siep
-- 
Posted via http://www.ruby-forum.com/.