How to redirect output to another directory?

Never mind. I just figured it out:

 File.new("./output/"+field[0],"w+").write(content2)

Thx.

-Kurt

···

-----Original Message-----
From: Kurt Euler [mailto:keuler@portal.com]
Sent: Saturday, June 08, 2002 10:09 PM
To: ruby-talk@ruby-lang.org
Subject: How to redirect output to another directory?..

All-

The last line of the following code writes a bunch of files in the current directory (…/ruby/bin).

 content = File.new("template1.txt").read
 fs = File.new("fiddle.sticks").read
 IO.foreach("packages.txt") { |x|
   field = x.chop.split(':')
   content2 = content
   content2.gsub!(/<release_num>/, fs)
   File.new(field[0],"w+").write(content2)
 }

Question: How can I redirect the output to the subdirectory “…/ruby/bin/output”?

I would have thought that I could rewrite the last line thus:

   File.new(field[0],"w+").write("./output/" << content2)

But this has no effect on the output.

Thanks!

-Kurt Euler